Hello,

The diff below adds pledge(2) to mail/abook. Generally, abook
requires the stdio, and {r,w,c}path promises. The tty promise is
used for the curses user-interface, while proc and exec are needed
for launching lpr (for printing) and mutt.

Regards,
Aslan
Index: patch-abook_c
===================================================================
RCS file: patch-abook_c
diff -N patch-abook_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patch-abook_c       12 Feb 2019 08:32:45 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Pledge mail/abook.
+Note: proc and exec promises are only needed for launching lpr and mutt.
+
+Index: abook.c
+--- abook.c.orig
++++ abook.c
+@@ -190,6 +190,11 @@ quit_abook_sig(int i)
+ int
+ main(int argc, char **argv)
+ {
++      if (pledge("stdio rpath wpath cpath tty proc exec", NULL) == -1) {
++              perror("pledge");
++              exit(1);
++      }
++
+ #if defined(HAVE_SETLOCALE) && defined(HAVE_LOCALE_H)
+       setlocale(LC_MESSAGES, "");
+       setlocale(LC_TIME, "");

Reply via email to