diff options
author | 2017-08-11 20:49:26 +0000 | |
---|---|---|
committer | 2017-08-11 20:49:26 +0000 | |
commit | 5dd7bfae7fad0ba197c52e000009c23fe6cd4e29 (patch) | |
tree | 30d5793c3cf3825a56875971ca523fbfce485eb2 /usr.bin/ctfconv/ctfconv.c | |
parent | Fall back using db_print_cmd() if no CTF data has been found. (diff) | |
download | wireguard-openbsd-5dd7bfae7fad0ba197c52e000009c23fe6cd4e29.tar.xz wireguard-openbsd-5dd7bfae7fad0ba197c52e000009c23fe6cd4e29.zip |
pledge ctfconv
feedback/ok mpi@ tb@
Diffstat (limited to 'usr.bin/ctfconv/ctfconv.c')
-rw-r--r-- | usr.bin/ctfconv/ctfconv.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/usr.bin/ctfconv/ctfconv.c b/usr.bin/ctfconv/ctfconv.c index 6abdbdc6b21..8f8e2cd7a0a 100644 --- a/usr.bin/ctfconv/ctfconv.c +++ b/usr.bin/ctfconv/ctfconv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctfconv.c,v 1.5 2017/08/11 19:34:24 jasper Exp $ */ +/* $OpenBSD: ctfconv.c,v 1.6 2017/08/11 20:49:26 jasper Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -93,6 +93,9 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); + if (pledge("stdio rpath wpath cpath", NULL) == -1) + err(1, "pledge"); + while ((ch = getopt(argc, argv, "dl:o:")) != -1) { switch (ch) { case 'd': @@ -129,7 +132,19 @@ main(int argc, char *argv[]) if (error != 0) return error; + if (outfile != NULL) { + if (pledge("stdio wpath cpath", NULL) == -1) + err(1, "pledge"); + + error = generate(outfile, label, 1); + if (error != 0) + return error; + } + if (dump) { + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + int fidx = -1, oidx = -1; TAILQ_FOREACH(it, &iobjq, it_symb) @@ -150,12 +165,6 @@ main(int argc, char *argv[]) return 0; } - if (outfile != NULL) { - error = generate(outfile, label, 1); - if (error != 0) - return error; - } - return 0; } |