SUMMARY: weird file modes

From: Donald McLachlan (don@mars.dgrc.doc.ca)
Date: Wed Jan 18 1995 - 15:43:41 CST


The consensus is that the files are marked for SVR4 manditory file locking.

As shown in some (not 4.1.3_U1) man pages

> from chmod(2) - it enables mandatory file locking, per SVR4 semantics.
>
> S_ISGID 020#0 Set group ID on execution
> if # is 7, 5, 3, or 1.
> Enable mandatory file/record locking
> if # is 6, 4, 2, or 0.

one more question, if it is not in the 4.1.3_U1 man pages, does it work?

Thanks to Kevin.Sheehan@uniq.com.au and ric@Artisoft.COM.

A copy of my original post follows.

> From don Mon Jan 16 10:36:58 1995
> To: sun-managers@delta.eecs.nwu.edu
> Subject: weird file modes
> Content-Length: 1729
>
> cops is telling me about some setuid files (with a capital S).
>
>
> I decided to use my stat program (prints the values returned by the stat
> sys-call) and here is what I got:
>
> jack don> a.out /home/mars/vitali/.MUA/summary
> /home/mars/vitali/.MUA/summary
> st_dev = -32249
> st_ino = 23368
> st_mode = 0o102600
> st_nlink = 1
> st_uid = 110
> st_gid = 100
> st_rdev = 14952
> st_size = 78660
> st_atime = Sun Jan 15 02:10:01 1995
> st_mtime = Sun Jan 15 02:10:01 1995
> st_ctime = Sun Jan 15 02:10:01 1995
> st_blksize = 8192
> st_blocks = 154
>
> OK, the mode bits 10 say it is a normal file.
> 2 says it is setgid on exec.
> 600 says read/write by owner.
>
> Any idea why one would have the setgid bit set on a non-executable file?
>
> The only thing I have seen (in <sys/stat.h>) is:
>
> #define S_ISUID 0004000 /* set user id on execution */
> #define S_ISGID 0002000 /* set group id on execution */
> #ifndef _POSIX_SOURCE
> #define S_ISVTX 0001000 /* save swapped text even after use */
> #define S_IREAD 0000400 /* read permission, owner */
> #define S_IWRITE 0000200 /* write permission, owner */
> #define S_IEXEC 0000100 /* execute/search permission, owner */
>
> >>>>> #define S_ENFMT 0002000 /* enforcement-mode locking */
>
> #define S_IFMT _IFMT
> #define S_IFDIR _IFDIR
> #define S_IFCHR _IFCHR
> #define S_IFBLK _IFBLK
> #define S_IFREG _IFREG
> #define S_IFLNK _IFLNK
> #define S_IFSOCK _IFSOCK
> #define S_IFIFO _IFIFO
> #endif !_POSIX_SOURCE
>
> 1 - Is this stuff in effect in SunOS 4.1.3_U1b?
> 2 - What does this do, enforce exclusive use?
>
> Don
>



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:14 CDT