projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
setgid to group "write" so that terminals need not be world writable
[unix-history]
/
usr
/
src
/
usr.bin
/
mesg
/
mesg.c
diff --git
a/usr/src/usr.bin/mesg/mesg.c
b/usr/src/usr.bin/mesg/mesg.c
index
9b37f09
..
266937a
100644
(file)
--- 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.
/*
* 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) {
exit(13);
if(stat(tty, &sbuf) < 0) error("cannot stat");
if(argc < 2) {
- if(sbuf.st_mode & 02)
+ if(sbuf.st_mode & 02
0
)
fprintf(stderr,"is y\n");
else { r=1;
fprintf(stderr,"is n\n");
}
} else switch(*argv[1]) {
case 'y':
fprintf(stderr,"is y\n");
else { r=1;
fprintf(stderr,"is n\n");
}
} else switch(*argv[1]) {
case 'y':
- newmode(sbuf.st_mode|02
2
); break;
+ newmode(sbuf.st_mode|02
0
); break;
case 'n':
case 'n':
- newmode(sbuf.st_mode&~02
2
); r=1; break;
+ newmode(sbuf.st_mode&~02
0
); r=1; break;
default:
error("usage: mesg [y] [n]");
default:
error("usage: mesg [y] [n]");