Skip to content

Commit

Permalink
Add OpenBSD pledge
Browse files Browse the repository at this point in the history
  • Loading branch information
pdewacht committed Jan 26, 2018
1 parent 39ed3c5 commit 3008302
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ int main(int argc, char *argv[]) {
}
}

#ifdef __OpenBSD__
if (pledge("stdio", nullptr) != 0) {
fprintf(stderr, "ERROR: " PACKAGE ": pledge failed\n");
return 1;
}
#endif

ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
if (!ras) {
fprintf(stderr, "DEBUG: " PACKAGE ": Cannot read raster data. Most likely an earlier filter in the pipeline failed.\n");
Expand Down

0 comments on commit 3008302

Please sign in to comment.