summaryrefslogtreecommitdiff
path: root/libexec/tradcpp
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-09 12:20:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-09 12:20:19 +0000
commit230f885abb8fb82ae220426f5b5d38dd62a778cf (patch)
treec7884572a35124e9a9740c3d66c9123d3a929819 /libexec/tradcpp
parentf357fd1f6f337d7f496966c82bac5f93156997d1 (diff)
this cpp operates file using pledge "stdio rpath wpath cpath"
Diffstat (limited to 'libexec/tradcpp')
-rw-r--r--libexec/tradcpp/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libexec/tradcpp/main.c b/libexec/tradcpp/main.c
index eae7f44632d..267c279be5e 100644
--- a/libexec/tradcpp/main.c
+++ b/libexec/tradcpp/main.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <errno.h>
@@ -1037,6 +1038,11 @@ main(int argc, char *argv[])
progname = progname == NULL ? argv[0] : progname + 1;
complain_init(progname);
+ if (pledge("stdio rpath wpath cpath", NULL) == -1) {
+ fprintf(stderr, "%s: pledge: %s", progname, strerror(errno));
+ exit(1);
+ }
+
init();
for (i=1; i<argc; i++) {