summaryrefslogtreecommitdiff
path: root/bin/chmod/chmod.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 05:05:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 05:05:07 +0000
commit1be277456921d53c9250470a225d11e3f643ae01 (patch)
tree30a165c229fd5fd0d1cba1ae2f2d6bf4fbc3b53b /bin/chmod/chmod.c
parent5f94a3f24d3a2f3d8c93737be5ae2cdd6f9cecd1 (diff)
the chmod & chflags codepaths can use tame "stdio rpath fattr". the
chown codepath obviously cannot use tame -- once tame is activated the kernel prohibits changing uid/gid on a fd/file. ok guenther
Diffstat (limited to 'bin/chmod/chmod.c')
-rw-r--r--bin/chmod/chmod.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index d0665c19a70..ef9ada68df5 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chmod.c,v 1.35 2015/10/03 03:30:04 deraadt Exp $ */
+/* $OpenBSD: chmod.c,v 1.36 2015/10/03 05:05:06 deraadt Exp $ */
/* $NetBSD: chmod.c,v 1.12 1995/03/21 09:02:09 cgd Exp $ */
/*
@@ -153,6 +153,9 @@ done:
atflags = 0;
if (ischflags) {
+ if (tame("stdio rpath fattr", NULL) == -1)
+ err(1, "tame");
+
flags = *argv;
if (*flags >= '0' && *flags <= '7') {
errno = 0;
@@ -172,6 +175,9 @@ done:
oct = 0;
}
} else if (ischmod) {
+ if (tame("stdio rpath fattr", NULL) == -1)
+ err(1, "tame");
+
mode = *argv;
if (*mode >= '0' && *mode <= '7') {
errno = 0;