diff options
author | 2015-11-15 23:14:21 +0000 | |
---|---|---|
committer | 2015-11-15 23:14:21 +0000 | |
commit | 66401f6bb94723fc1ede5e7b0818084c1b19c3c1 (patch) | |
tree | 4500260358b713ef1a5687eebfb4741208f9079d | |
parent | Really silly to chmod "st_mode & 07777" when making a copy of the (diff) | |
download | wireguard-openbsd-66401f6bb94723fc1ede5e7b0818084c1b19c3c1.tar.xz wireguard-openbsd-66401f6bb94723fc1ede5e7b0818084c1b19c3c1.zip |
pledge "stdio rpath wpath cpath fattr getpw flock id proc exec" at the
top. It is a lot, maybe someone will take the time to find smaller
chunks later in the program.
tested by jca
-rw-r--r-- | usr.sbin/user/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/user/main.c b/usr.sbin/user/main.c index 6e7d7612ef1..4c0cd9f8a6c 100644 --- a/usr.sbin/user/main.c +++ b/usr.sbin/user/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.7 2011/12/31 14:05:51 ajacoutot Exp $ */ +/* $OpenBSD: main.c,v 1.8 2015/11/15 23:14:21 deraadt Exp $ */ /* $NetBSD: main.c,v 1.3 2002/07/09 10:34:16 tron Exp $ */ /* @@ -80,6 +80,10 @@ main(int argc, char **argv) int matched; int i; + if (pledge("stdio rpath wpath cpath fattr getpw flock id proc exec", + NULL) == -1) + err(1, "pledge"); + for (cmdp = cmds ; cmdp->c_wc > 0 ; cmdp++) { for (matched = i = 0 ; i < cmdp->c_wc && i < MaxCmdWords ; i++) { if (argc > i) { |