1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

Add a patch:

- stop using mlock as it requires root credential
- call ev_loop_fork so that forking actually works with kqueue
This commit is contained in:
Baptiste Daroussin 2013-03-20 17:13:42 +00:00
parent 462032dca1
commit e555bb2656
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=314748
2 changed files with 42 additions and 6 deletions

View File

@ -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/ \

View File

@ -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 dont 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). */