diff options
author | deraadt <deraadt@openbsd.org> | 2015-11-05 16:15:47 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2015-11-05 16:15:47 +0000 |
commit | 7a1953db5c956d0c2878238b00023650322bc63d (patch) | |
tree | 148b597e659ddddc9459cc102a3276dec00c6ed9 /usr.sbin/kvm_mkdb | |
parent | for mice with wheels, check for W direction at AC Pan input used in (diff) | |
download | wireguard-openbsd-7a1953db5c956d0c2878238b00023650322bc63d.tar.xz wireguard-openbsd-7a1953db5c956d0c2878238b00023650322bc63d.zip |
there is a retry path in here which contains rename() and fchown().
Use a slightly larger pledge, earlier on.
from gregor best
Diffstat (limited to 'usr.sbin/kvm_mkdb')
-rw-r--r-- | usr.sbin/kvm_mkdb/kvm_mkdb.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c index fa4c20393d5..5759f4bb454 100644 --- a/usr.sbin/kvm_mkdb/kvm_mkdb.c +++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_mkdb.c,v 1.24 2015/10/16 13:37:44 millert Exp $ */ +/* $OpenBSD: kvm_mkdb.c,v 1.25 2015/11/05 16:15:47 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -98,6 +98,9 @@ main(int argc, char *argv[]) if (argc > 1) usage(); + if (pledge("stdio rpath wpath cpath fattr flock", NULL) == -1) + err(1, "pledge"); + /* If no kernel specified use _PATH_KSYMS and fall back to _PATH_UNIX */ if (argc > 0) { nlistpath = argv[0]; @@ -169,10 +172,6 @@ kvm_mkdb(int fd, const char *dbdir, char *nlistpath, char *nlistname, return(1); } - /* rename() later */ - if (pledge("stdio rpath wpath cpath flock", NULL) == -1) - err(1, "pledge"); - if (create_knlist(nlistpath, fd, db) != 0) { warn("cannot determine executable type of %s", nlistpath); (void)unlink(dbtemp); |