Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2013 17:13:42 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r314748 - in head/x11/i3lock: . files
Message-ID:  <201303201713.r2KHDgTK012794@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Mar 20 17:13:42 2013
New Revision: 314748
URL: http://svnweb.freebsd.org/changeset/ports/314748

Log:
  Add a patch:
  - stop using mlock as it requires root credential
  - call ev_loop_fork so that forking actually works with kqueue

Added:
  head/x11/i3lock/files/patch-i3lock.c   (contents, props changed)
Modified:
  head/x11/i3lock/Makefile

Modified: head/x11/i3lock/Makefile
==============================================================================
--- head/x11/i3lock/Makefile	Wed Mar 20 17:03:00 2013	(r314747)
+++ head/x11/i3lock/Makefile	Wed Mar 20 17:13:42 2013	(r314748)
@@ -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/ \

Added: head/x11/i3lock/files/patch-i3lock.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/i3lock/files/patch-i3lock.c	Wed Mar 20 17:13:42 2013	(r314748)
@@ -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). */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303201713.r2KHDgTK012794>