[sudo-users] Problem with CD command while using sudo
Todd C. Miller
Todd.Miller at courtesan.com
Fri Jul 29 15:33:26 EDT 2005
In message <20050729191328.GC1210 at loosenut.com>
so spake Russell Van Tassell (russell+sudo-users):
> This is highly OS/shell dependent... while some shells use an intrinsic,
> others actually call a script or similar. Since cd essentially, at some
> point, works on the current shell, any call to sudo will fork a separat
> process that, when it dies, leaves the parent shell unaffected. (in a
> nutshell, at least)
I challenge you to find a Unix system where cd is *not* a shell
builtin. It is true that some systems have a /usr/bin/cd command
but that is due to POSIX requiring that all shell builtins have
equialents in /usr/bin. It's not actually usable for anything
and it actually relies on cd being a builtin in the first place.
- todd
More information about the sudo-users
mailing list