pledge x11/xcape

add a simple patch to pledge("stdio") xcape.  Tested also by Thim
Cederlund, thanks!
This commit is contained in:
op 2022-09-11 07:27:29 +00:00
parent e99aee537c
commit 956010c76a
2 changed files with 20 additions and 0 deletions

View File

@ -3,12 +3,14 @@ COMMENT = configure a modifier key when pressed and released by itself
GH_ACCOUNT = alols
GH_PROJECT = xcape
GH_TAGNAME = v1.2
REVISION = 0
CATEGORIES = x11
# GPLv3+
PERMIT_PACKAGE = Yes
# uses pledge()
WANTLIB += X11 Xtst c pthread
MAKE_FLAGS = PREFIX=${PREFIX} \

View File

@ -0,0 +1,18 @@
pledge it
Index: xcape.c
--- xcape.c.orig
+++ xcape.c
@@ -191,6 +191,12 @@ int main (int argc, char **argv)
if (self->debug != True)
daemon (0, 0);
+ if (pledge ("stdio", NULL) == -1)
+ {
+ fprintf (stderr, "pledge: %s\n", strerror(errno));
+ exit (EXIT_FAILURE);
+ }
+
sigemptyset (&self->sigset);
sigaddset (&self->sigset, SIGINT);
sigaddset (&self->sigset, SIGTERM);