summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpascal <pascal@openbsd.org>2015-11-16 17:49:35 +0000
committerpascal <pascal@openbsd.org>2015-11-16 17:49:35 +0000
commit3e7a1d1af26c1edb32ae16114d6f88b4f268bc24 (patch)
tree28342933321a2e84559b4dc18f243d15005cdbf0
parentpledge for gprof: "stdio rpath wpath cpath" in the beginning, then drop (diff)
downloadwireguard-openbsd-3e7a1d1af26c1edb32ae16114d6f88b4f268bc24.tar.xz
wireguard-openbsd-3e7a1d1af26c1edb32ae16114d6f88b4f268bc24.zip
pledge calendar:
* "stdio rpath proc exec" in normal mode (execs cpp) * "stdio rpath tmppath fattr id proc exec" in -a mode, which is typically run as root (hint hint) ok deraadt@
-rw-r--r--usr.bin/calendar/calendar.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index a789de2a8d7..b80ef44dccc 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: calendar.c,v 1.32 2015/10/23 11:43:16 zhuk Exp $ */
+/* $OpenBSD: calendar.c,v 1.33 2015/11/16 17:49:35 pascal Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -118,6 +118,15 @@ main(int argc, char *argv[])
if (argc)
usage();
+ if (doall) {
+ if (pledge("stdio rpath tmppath fattr id proc exec", NULL)
+ == -1)
+ err(1, "pledge");
+ } else {
+ if (pledge("stdio rpath proc exec", NULL) == -1)
+ err(1, "pledge");
+ }
+
/* use current time */
if (f_time <= 0)
(void)time(&f_time);