[Linux-disciples] Mkdir suid?

Stephen R Laniel steve at laniels.org
Tue Aug 17 23:26:11 EDT 2004


I'm reading Ritchie and Thompson's original paper on UNIX
[1] right now, and I see the following in a description of
the setuid bit:

"For example, there is a system entry invocable only by the
'super-user' (below) which creates an empty directory. As
indicated above, directories are expected to have entries
for '.' and '..'. The command which creates a directory is
owned by the super user and has the set-user-ID bit set.
After it checks its invoker's authorization to create the
specified directory, it creates it and makes the entries for
'.' and '..'."

I can't really think of why mkdir should run
setuid. mkdir needs to check whether I have the credentials
to create a directory in my current directory, so it needs
to check the access privileges on the current directory. So
it needs read access to /etc/passwd and /etc/group, I
presume, but everyone has such access. Does anyone know if
there was tighter security on those files under early
Unices? Or am I missing something about how security works
*now*?

[1] - http://shorl.com/bogrudrujaronu

-- 
``He even provides a fountain for two characters to stand
  beside, so they can illustrate Gene Siskel's maxim that
  nobody in a comedy ever comes within 10 yards of water
  without falling in.''
 -Roger Ebert, http://shorl.com/hyfeprutekosi



More information about the Linux-disciples mailing list