diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-09 12:20:19 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-09 12:20:19 +0000 |
commit | 230f885abb8fb82ae220426f5b5d38dd62a778cf (patch) | |
tree | c7884572a35124e9a9740c3d66c9123d3a929819 /libexec/tradcpp | |
parent | f357fd1f6f337d7f496966c82bac5f93156997d1 (diff) |
this cpp operates file using pledge "stdio rpath wpath cpath"
Diffstat (limited to 'libexec/tradcpp')
-rw-r--r-- | libexec/tradcpp/main.c | 6 |
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++) { |