aboutsummaryrefslogtreecommitdiff
path: root/x11/i3lock
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-03-20 17:13:42 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-03-20 17:13:42 +0000
commite555bb2656ae58c248cf260dfef115dc357c34c0 (patch)
treee1dc2f2735da1b4a21d5bed48c24c1577f061a88 /x11/i3lock
parent462032dca152fa15cb1712074f5097cc737de1b7 (diff)
downloadports-e555bb2656ae58c248cf260dfef115dc357c34c0.tar.gz
ports-e555bb2656ae58c248cf260dfef115dc357c34c0.zip
Notes
Diffstat (limited to 'x11/i3lock')
-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). */