On Sat, Oct 14, 2017 at 02:29:41PM -0400, Thierry wrote:
> 
> Hi,
> 
> Since revision 1.1 dunst stopped working and produced coredumps
> related to "syscsall 197 'protexec'". The latter indicated that
> pledge(2) detected an unauthorized system call not defined in the
> promises list. Below is a proposed fix which is running fine under
> OpenBSD 6.2 GENERIC.MP#0 amd64
> 

It pledges too early.

I was unable to reproduce your problem, but I ran into another pledge
issue with dunst trying to open a socket. I only tested this very
briefly, but this patch seems to work for me.

Please test this with various setups.

Index: Makefile
===================================================================
RCS file: /var/cvs/ports/x11/dunst/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile    31 Aug 2017 20:57:00 -0000      1.3
+++ Makefile    14 Oct 2017 19:01:14 -0000
@@ -5,6 +5,7 @@ COMMENT=        customizable and lightweight no
 GH_ACCOUNT =   dunst-project
 GH_PROJECT =   dunst
 GH_TAGNAME =   v1.2.0
+REVISION =     0
 
 CATEGORIES =   x11
 
Index: patches/patch-src_dunst_c
===================================================================
RCS file: /var/cvs/ports/x11/dunst/patches/patch-src_dunst_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-src_dunst_c
--- patches/patch-src_dunst_c   31 Aug 2017 20:57:00 -0000      1.1
+++ patches/patch-src_dunst_c   14 Oct 2017 18:57:08 -0000
@@ -13,13 +13,13 @@ Index: src/dunst.c
  #include "dbus.h"
  #include "menu.h"
  #include "notification.h"
-@@ -325,6 +328,9 @@ int dunst_main(int argc, char *argv[])
-         int owner_id = initdbus();
- 
-         x_setup();
-+      
+@@ -352,6 +356,9 @@ int dunst_main(int argc, char *argv[])
+                 NULL,
+                 NULL
+         };
++
 +        if (pledge("stdio rpath proc exec", NULL) == -1)
 +                err(1, "pledge");
  
-         if (settings.startup_notification) {
-                 notification *n = notification_create();
+         GSource *x11_source =
+             g_source_new(&x11_source_funcs, sizeof(x11_source_t));

Reply via email to