Thread View: comp.bugs.2bsd
1 messages
1 total messages
Started by Steven M. Schultz
Thu, 20 Jul 1989 21:45
rwhod files have wrong mode
Author: Steven M. Schultz
Date: Thu, 20 Jul 1989 21:45
Date: Thu, 20 Jul 1989 21:45
24 lines
1324 bytes
1324 bytes
This isn't really a "bug", but a fix for an annoyance. 'rwhod' uses the system default for its umask() and can end up creating files which only the superuser can read. the choice was to either make 'ruptime' setuid or reserved to superusers only, or to have 'rwhod' change the mode to something reasonable. The fix below or's in 0444 to the mode - forcing the files to be readable by everyone. *** rwhod.c.old Wed Jul 12 23:47:51 1989 --- rwhod.c Thu Jul 20 13:48:33 1989 *************** *** 223,228 **** --- 223,231 ---- (void) write(whod, (char *)&wd, cc); if (fstat(whod, &st) < 0 || st.st_size > cc) ftruncate(whod, (long)cc); + #define ALLREAD (S_IREAD | (S_IREAD >> 3) | (S_IREAD >>6)) + if ((st.st_mode & ALLREAD) != ALLREAD) + fchmod(whod, st.st_mode | ALLREAD); (void) close(whod); } }
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads