summaryrefslogtreecommitdiffstats
path: root/usr.sbin/quot
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2018-07-26 13:37:40 +0000
committermestre <mestre@openbsd.org>2018-07-26 13:37:40 +0000
commitb80ce67392425d829c55aad7a963fb04cee3a910 (patch)
tree335f817e28925c344ea94b1705f86f17d43ce1fc /usr.sbin/quot
parentAdd infrastructure to install lld as the default linker. The old GNU linker (diff)
downloadwireguard-openbsd-b80ce67392425d829c55aad7a963fb04cee3a910.tar.xz
wireguard-openbsd-b80ce67392425d829c55aad7a963fb04cee3a910.zip
add pledge(2) to quot(8):
- rpath to traverse the filesystem(s) - getpw to figure out who owns what OK tb@ deraadt@
Diffstat (limited to 'usr.sbin/quot')
-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++) {