aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-03-21 01:13:42 +0800
committerbapt <bapt@FreeBSD.org>2013-03-21 01:13:42 +0800
commit69de3879926ff2186272cfeb7073e696e06e61e6 (patch)
treee1dc2f2735da1b4a21d5bed48c24c1577f061a88 /x11
parent24763ad730d8f1d8204c1a9f4f0b32e7fabe05c0 (diff)
downloadfreebsd-ports-gnome-69de3879926ff2186272cfeb7073e696e06e61e6.tar.gz
freebsd-ports-gnome-69de3879926ff2186272cfeb7073e696e06e61e6.tar.zst
freebsd-ports-gnome-69de3879926ff2186272cfeb7073e696e06e61e6.zip
Add a patch:
- stop using mlock as it requires root credential - call ev_loop_fork so that forking actually works with kqueue
Diffstat (limited to 'x11')
-rw-r--r--x11/i3lock/Makefile8
-rw-r--r--x11/i3lock/files/patch-i3lock.c40
2 files changed, 42 insertions, 6 deletions
diff --git a/x11/i3lock/Makefile b/x11/i3lock/Makefile
index d15893c59ba8..254cfd010de3 100644
--- a/x11/i3lock/Makefile
+++ b/x11/i3lock/Makefile
@@ -1,13 +1,9 @@
-# New ports collection makefile for: i3lock
-# Date created: 2009-05-22
-# Whom: Dennis Herrmann <dhn@FreeBSD.org>
-#
+# Created by: Dennis Herrmann <dhn@FreeBSD.org>
# $FreeBSD$
-#
PORTNAME= i3lock
PORTVERSION= 2.4.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11
MASTER_SITES= http://i3wm.org/${PORTNAME}/ \
http://mirror.4bit.ws/ \
diff --git a/x11/i3lock/files/patch-i3lock.c b/x11/i3lock/files/patch-i3lock.c
new file mode 100644
index 000000000000..6cf6bda57750
--- /dev/null
+++ b/x11/i3lock/files/patch-i3lock.c
@@ -0,0 +1,40 @@
+--- ./i3lock.c.orig 2013-03-19 21:44:37.876383724 +0100
++++ ./i3lock.c 2013-03-20 19:23:55.060606716 +0100
+@@ -525,6 +525,8 @@
+ /* In the parent process, we exit */
+ if (fork() != 0)
+ exit(0);
++
++ ev_loop_fork(EV_DEFAULT);
+ }
+ break;
+
+@@ -645,11 +647,16 @@
+ if (ret != PAM_SUCCESS)
+ errx(EXIT_FAILURE, "PAM: %s", pam_strerror(pam_handle, ret));
+
++/* Using mlock() as non-super-user seems only possible in Linux. Users of other
++ * operating systems should use encrypted swap/no swap (or remove the ifdef and
++ * run i3lock as super-user). */
++#if defined(__linux__)
+ /* Lock the area where we store the password in memory, we don’t want it to
+ * be swapped to disk. Since Linux 2.6.9, this does not require any
+ * privileges, just enough bytes in the RLIMIT_MEMLOCK limit. */
+ if (mlock(password, sizeof(password)) != 0)
+ err(EXIT_FAILURE, "Could not lock page in memory, check RLIMIT_MEMLOCK");
++#endif
+
+ /* Initialize connection to X11 */
+ if ((conn = xcb_connect(NULL, &nscreen)) == NULL ||
+@@ -731,9 +738,11 @@
+ ev_check_init(xcb_check, xcb_check_cb);
+ ev_check_start(main_loop, xcb_check);
+
++ ev_check_init(xcb_check, xcb_check_cb);
+ ev_prepare_init(xcb_prepare, xcb_prepare_cb);
+ ev_prepare_start(main_loop, xcb_prepare);
+
++ ev_check_init(xcb_check, xcb_check_cb);
+ /* Invoke the event callback once to catch all the events which were
+ * received up until now. ev will only pick up new events (when the X11
+ * file descriptor becomes readable). */