On Thu, Apr 22, 2010 at 11:51:39PM -0400, Glenn Fowler wrote:
> 
> re: using a sh implementation that doesn't set PWD
> from posix:
> 
> PWD
>   This variable shall represent an absolute pathname of the
>   current working directory. It shall not contain any
>   components that are dot or dot-dot. The value is set by the
>   cd utility, and by the sh utility during initialization.
> 
> if the shell runs any command then PWD will be in that command's environment
> unless it is explicitly unset before the command is executed

Right, so that normally the slow AST getcwd() is never even tried.  But
sendmail is exec()ing the shell with an empty environment... thus
there's no $PWD.  And sendmail is doing this with $HOME as the current
directory.  Since $HOME is likely automounted, and an NFS mount... the
risk of straying into stat()ing someone else's home directory whose
server is not responding is very high.

Granted, sendmail could set PWD and HOME (and USER), and, IMO, should.
But it doesn't.

Nico
-- 
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss

Reply via email to