From: Kirk McKusick Date: Fri, 14 Mar 1986 12:29:23 +0000 (-0800) Subject: setgid to group "write" so that terminals need not be world writable X-Git-Tag: BSD-4_3-Snapshot-Development~3012 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/1d3c77a8241b6c361e53e15d6306cefb1db6229f setgid to group "write" so that terminals need not be world writable SCCS-vsn: usr.bin/mesg/mesg.c 4.3 SCCS-vsn: usr.bin/finger/finger.c 5.8 --- diff --git a/usr/src/usr.bin/finger/finger.c b/usr/src/usr.bin/finger/finger.c index 207cfd49bb..84341c80b3 100644 --- a/usr/src/usr.bin/finger/finger.c +++ b/usr/src/usr.bin/finger/finger.c @@ -11,7 +11,7 @@ char copyright[] = #endif not lint #ifndef lint -static char sccsid[] = "@(#)finger.c 5.7 (Berkeley) %G%"; +static char sccsid[] = "@(#)finger.c 5.8 (Berkeley) %G%"; #endif not lint /* @@ -71,7 +71,7 @@ static char sccsid[] = "@(#)finger.c 5.7 (Berkeley) %G%"; #define CORY 'C' /* cory hall office */ #define EVANS 'E' /* evans hall office */ #define SAMENAME '&' /* repeat login name in real name */ -#define TALKABLE 0222 /* tty is writable if 222 mode */ +#define TALKABLE 0220 /* tty is writable if 220 mode */ struct utmp user; #define NMAX sizeof(user.ut_name) diff --git a/usr/src/usr.bin/mesg/mesg.c b/usr/src/usr.bin/mesg/mesg.c index 9b37f0909e..266937af9c 100644 --- a/usr/src/usr.bin/mesg/mesg.c +++ b/usr/src/usr.bin/mesg/mesg.c @@ -1,4 +1,4 @@ -static char *sccsid = "@(#)mesg.c 4.2 (Berkeley) %G%"; +static char *sccsid = "@(#)mesg.c 4.3 (Berkeley) %G%"; /* * mesg -- set current tty to accept or * forbid write permission. @@ -26,17 +26,17 @@ char *argv[]; exit(13); if(stat(tty, &sbuf) < 0) error("cannot stat"); if(argc < 2) { - if(sbuf.st_mode & 02) + if(sbuf.st_mode & 020) fprintf(stderr,"is y\n"); else { r=1; fprintf(stderr,"is n\n"); } } else switch(*argv[1]) { case 'y': - newmode(sbuf.st_mode|022); break; + newmode(sbuf.st_mode|020); break; case 'n': - newmode(sbuf.st_mode&~022); r=1; break; + newmode(sbuf.st_mode&~020); r=1; break; default: error("usage: mesg [y] [n]");