Glenn Fowler wrote:
> On Mon, 25 Sep 2006 10:28:10 -0400 James Carlson wrote:
>> John Plocher writes:
>>> This implies that the fix needs to be in libcmd and not in ksh93
> 
>> It can't be in libcmd, because those external programs themselves will
>> link to libcmd to get the implementation there.  You'd just recurse
>> forever.
> 
>> In order for this to work, either (A) all applications using libcmd
>> must become smart enough to know when to do exec() instead or (B) no
>> application other than a /usr/bin/* utility implemented by way of
>> libcmd should ever link against libcmd.
> 
> does this mean that the sh implementation makes some kind of contract
> on what system calls it will make? e.g., if chmod(1) requires pfexec,
> then can the sh implementation make a call to chmod(2) under any
> circumstances?

sh just doesn't do that though since it has no chmod(1) builtin this is 
never a problem in that codebase.   The shell_builtins(1) man page on 
Solaris systems should be up to date on what is and is not builtin for 
what is currently being shipped.

If ksh93 calls chmod(2) for its own use for any reason, ie other than 
scripted or interactive use of chmod then it would call chmod(2) without 
using pfexec that is fine.  If it is causing chmod(1) to be run, because 
a user typed it interactively or it was in a script, then when operating 
in profile mode it should not use the builtin but should pfexec 
/usr/bin/chmod.


-- 
Darren J Moffat

Reply via email to