From 3008302bb51c20c61d1f5f12db54b386ad91a095 Mon Sep 17 00:00:00 2001 From: Peter De Wachter Date: Fri, 26 Jan 2018 23:54:21 +0100 Subject: [PATCH] Add OpenBSD pledge --- src/main.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cc b/src/main.cc index 259a708..6eafcdd 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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");