What does SUID, SGID and Sticky bits do on inappropriate files?

David J. MacKenzie djm at eng.umd.edu
Wed Dec 26 04:55:01 AEST 1990


In article <BZS.90Dec25021220 at world.std.com> bzs at world.std.com (Barry Shein) writes:
> Interestingly, on SunOS 4.x I can't even set the sticky bit on plain
> or executable files (thinking it was the utilities ls and/or chmod
> fighting with me I wrote a quick hack to do it thru chmod() and read
> it back with stat(), no dice, never got set.) I was able to set the
> sticky and setid bits on a device file though.

Regular users can't, but the superuser can.

egypt# id
uid=0(root) gid=1(daemon) groups=1(daemon),10(staff),12(pr-cntl)
egypt# cp /dev/null xyzzy
egypt# ls -l xyzzy
-rw-r--r--   1 root     staff           0 Dec 25 12:53 xyzzy
egypt# chmod 1644 xyzzy
egypt# ls -l xyzzy
-rw-r--r-T   1 root     staff           0 Dec 25 12:53 xyzzy
egypt# chmod 1755 xyzzy
egypt# ls -l xyzzy
-rwxr-xr-t   1 root     staff           0 Dec 25 12:53 xyzzy
--
David J. MacKenzie <djm at eng.umd.edu> <djm at ai.mit.edu>



More information about the Comp.unix.internals mailing list