[wiki] [sites] [dwm] Add pledge patch || Klemens Nanni

From: <git_AT_suckless.org>
Date: Tue, 22 May 2018 16:01:43 +0200

commit da6e9a4f73606c63eaee7d80f6460a94d39a88d5
Author: Klemens Nanni <kn_AT_openbsd.org>
Date: Sun May 20 14:58:30 2018 +0200

    [dwm] Add pledge patch

diff --git a/dwm.suckless.org/patches/pledge/dwm-pledge-20180522-c8e9479.diff b/dwm.suckless.org/patches/pledge/dwm-pledge-20180522-c8e9479.diff
new file mode 100644
index 00000000..20a24309
--- /dev/null
+++ b/dwm.suckless.org/patches/pledge/dwm-pledge-20180522-c8e9479.diff
_AT_@ -0,0 +1,13 @@
+diff --git a/dwm.c b/dwm.c
+index bb95e26..abfb097 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -2137,6 +2137,8 @@ main(int argc, char *argv[])
+ die("dwm: cannot open display");
+ checkotherwm();
+ setup();
++ if (pledge("stdio proc exec", NULL) == -1)
++ die("pledge");
+ scan();
+ run();
+ cleanup();
diff --git a/dwm.suckless.org/patches/pledge/dwm-pledge-6.1.diff b/dwm.suckless.org/patches/pledge/dwm-pledge-6.1.diff
new file mode 100644
index 00000000..dbbb16a2
--- /dev/null
+++ b/dwm.suckless.org/patches/pledge/dwm-pledge-6.1.diff
_AT_@ -0,0 +1,12 @@
+Index: dwm.c
+--- dwm.c.orig
++++ dwm.c
+_AT_@ -2133,6 +2133,8 @@ main(int argc, char *argv[])
+ die("dwm: cannot open display
");
+ checkotherwm();
+ setup();
++ if (pledge("stdio proc exec", NULL) == -1)
++ die("pledge
");
+ scan();
+ run();
+ cleanup();
diff --git a/dwm.suckless.org/patches/pledge/index.md b/dwm.suckless.org/patches/pledge/index.md
new file mode 100644
index 00000000..32a575a2
--- /dev/null
+++ b/dwm.suckless.org/patches/pledge/index.md
_AT_@ -0,0 +1,18 @@
+pledge
+======
+
+Description
+-----------
+
+Restrict system operations on OpenBSD using [pledge(2)](https://man.openbsd.org/pledge).
+
+Download
+--------
+
+ * [dwm-pledge-6.1.diff](dwm-pledge-6.1.diff)
+ * [dwm-pledge-20180522-c8e9479.diff](dwm-pledge-20180522-c8e9479.diff)
+
+Authors
+-------
+
+ * Klemens Nanni <kn_AT_openbsd.org>
Received on Tue May 22 2018 - 16:01:43 CEST

This archive was generated by hypermail 2.3.0 : Tue May 22 2018 - 16:12:24 CEST