Sorry, forgot to increment the revision number in previous message.

On Tue, Feb 12, 2019 at 03:51:15AM -0500, Mohamed Aslan wrote:
> 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, "");


-- 
Mohamed Aslan, Ph.D.
Postdoctoral Research Associate
Department of Systems and Computer Engineering
Carleton University
Ottawa, ON, Canada
http://www.sce.carleton.ca/~maslan/
Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/abook/Makefile,v
retrieving revision 1.37
diff -u -p -u -r1.37 Makefile
--- Makefile    8 Feb 2019 09:50:21 -0000       1.37
+++ Makefile    12 Feb 2019 09:04:52 -0000
@@ -3,7 +3,7 @@
 COMMENT=               addressbook program with mutt support
 
 DISTNAME=              abook-0.6.1
-REVISION=              2
+REVISION=              3
 CATEGORIES=            mail
 
 HOMEPAGE=              http://abook.sourceforge.net/
Index: patches/patch-abook_c
===================================================================
RCS file: patches/patch-abook_c
diff -N patches/patch-abook_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-abook_c       12 Feb 2019 09:04:52 -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