summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-07-26 13:37:41 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-07-26 13:37:41 +0000
commitbe47dfd1ce177eb3236e54568120707a04c07f88 (patch)
treece567db4d2161e301861c4e3bf88452d5d5caaf7
parenta4e97e10814a72f3d111ea3d20c27f4907e0599f (diff)
add pledge(2) to quot(8):
- rpath to traverse the filesystem(s) - getpw to figure out who owns what OK tb@ deraadt@
-rw-r--r--usr.sbin/quot/quot.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index 26517892fea..56a2a83a39b 100644
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quot.c,v 1.30 2017/09/07 03:24:09 tedu Exp $ */
+/* $OpenBSD: quot.c,v 1.31 2018/07/26 13:37:40 mestre Exp $ */
/*
* Copyright (C) 1991, 1994 Wolfgang Solfrank.
@@ -572,6 +572,10 @@ main(int argc, char *argv[])
}
}
}
+
+ if (pledge("stdio rpath getpw", NULL) == -1)
+ err(1, "pledge");
+
cnt = getmntinfo(&mp, MNT_NOWAIT);
if (all) {
for (; --cnt >= 0; mp++) {