From: mestre Date: Thu, 26 Jul 2018 13:37:40 +0000 (+0000) Subject: add pledge(2) to quot(8): X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b80ce67392425d829c55aad7a963fb04cee3a910;p=openbsd add pledge(2) to quot(8): - rpath to traverse the filesystem(s) - getpw to figure out who owns what OK tb@ deraadt@ --- 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++) {