summaryrefslogtreecommitdiff
path: root/usr.bin/biff
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2016-07-07 09:26:27 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2016-07-07 09:26:27 +0000
commitbb3f7a6f2e480f0dbe9ba1ff2748ceca7871eb1d (patch)
treef4c82ffa9e8ed8f627a347c0de77c138c1751d67 /usr.bin/biff
parent0f429a3e055bb483d898517ce1786569700b42e8 (diff)
biff, mesg, vi: only consider ACCESSPERMS for setting tty mode.
it explicitly removes any S_ISUID|S_ISGID|S_ISTXT bits, instead of letting pledge(2) silenciously remove them. ok beck@ deraadt@
Diffstat (limited to 'usr.bin/biff')
-rw-r--r--usr.bin/biff/biff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index 382124ab2ce..0cf7fd5d66c 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biff.c,v 1.14 2015/12/29 19:04:46 gsoares Exp $ */
+/* $OpenBSD: biff.c,v 1.15 2016/07/07 09:26:25 semarie Exp $ */
/* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */
/*
@@ -67,6 +67,8 @@ main(int argc, char *argv[])
if (stat(name, &sb))
err(2, "stat");
+ sb.st_mode &= ACCESSPERMS;
+
if (*argv == NULL) {
(void)printf("is %s\n", sb.st_mode & S_IXUSR ? "y" : "n");
exit(sb.st_mode & S_IXUSR ? 0 : 1);