From: anna besprozannaya (besp@ellis.uchicago.edu)
Date: 07/18/92


From: besp@ellis.uchicago.edu (anna  besprozannaya)
Subject: How mkdir does it's magic ?
Date: Sun, 19 Jul 1992 04:52:54 GMT

Hello, everyone.
I've just installed MCC-interim 0.96c - and was really impressed:
everything comes up, and you get _really_ useful system !

I was explaining to a friend the "setuid" concept, explained to
him why mknod system call is only executable by root, and
proceeded to "That's why mkdir needs to be setuid-root":
> which mkdir
/bin/mkdir
> ls -l /bin/mkdir
-r-xr-xr-x 1 bin bin 3772 Jun 30 06:47 /bin/mkdir
?????????? where is setuid ??????????
Since that, I've tried little test program:
... if(mknod("mydir", S_IFDIR | 0755, 0) == -1) { perror("mknod"); exit(1) } ...
and it happily prints:
mknod: Operation not permitted (shouldn't it be "permission denied" ? :-)

I also tried digging mkdir's source on tsx-11, with little luck :-<

So, what's going on ?