I don't know if it matters, but we usually have

if ...
        pledge("some list"...
else ...
        pledge("other list"...

rather than using a variable.


On 2018/01/13 16:14, Timo Myyrä wrote:
> Hi,
> 
> Re-sending diff to update my email and fixing the pledge in dunst when using
> icons.
> 
> timo
> 
> Index: Makefile
> ===================================================================
> RCS file: /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  17 Dec 2017 15:13:56 -0000
> @@ -5,12 +5,13 @@ COMMENT=    customizable and lightweight no
>  GH_ACCOUNT = dunst-project
>  GH_PROJECT = dunst
>  GH_TAGNAME = v1.2.0
> +REVISION =   0
>  
>  CATEGORIES = x11
>  
>  HOMEPAGE=    https://dunst-project.org/
>  
> -MAINTAINER = Timo Myyra <timo.my...@wickedbsd.net>
> +MAINTAINER = Timo Myyra <timo.my...@bittivirhe.fi>
>  
>  # BSD
>  PERMIT_PACKAGE_CDROM=        Yes
> Index: patches/patch-src_dunst_c
> ===================================================================
> RCS file: /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 17 Dec 2017 15:13:56 -0000
> @@ -13,13 +13,21 @@ 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();
> -+    
> -+        if (pledge("stdio rpath proc exec", NULL) == -1)
> +@@ -368,6 +371,17 @@ int dunst_main(int argc, char *argv[])
> +          * graceful termination */
> +         guint term_src = g_unix_signal_add(SIGTERM, quit_signal, NULL);
> +         guint int_src = g_unix_signal_add(SIGINT, quit_signal, NULL);
> ++
> ++        /* allow prot_exec if icons are used */
> ++        char *pledge_str;
> ++        if (settings.icon_position != icons_off) {
> ++                pledge_str = "stdio rpath proc exec prot_exec";
> ++        } else {
> ++                pledge_str = "stdio rpath proc exec";
> ++        }
> ++
> ++        if (pledge(pledge_str, NULL) == -1)
>  +                err(1, "pledge");
>   
> -         if (settings.startup_notification) {
> -                 notification *n = notification_create();
> +         run(NULL);
> +         g_main_loop_run(mainloop);
> 

Reply via email to