=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctfconv/ctfconv.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/ctfconv/ctfconv.c 2017/08/11 19:34:24 1.5 --- src/usr.bin/ctfconv/ctfconv.c 2017/08/11 20:49:26 1.6 *************** *** 1,4 **** ! /* $OpenBSD: ctfconv.c,v 1.5 2017/08/11 19:34:24 jasper Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot --- 1,4 ---- ! /* $OpenBSD: ctfconv.c,v 1.6 2017/08/11 20:49:26 jasper Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot *************** *** 93,98 **** --- 93,101 ---- 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,135 **** --- 132,150 ---- 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) *************** *** 148,159 **** } return 0; - } - - if (outfile != NULL) { - error = generate(outfile, label, 1); - if (error != 0) - return error; } return 0; --- 163,168 ----