From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdkm-0006Jz-Uz for guix-patches@gnu.org; Fri, 17 Nov 2017 05:20:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFdkg-0006Dl-F6 for guix-patches@gnu.org; Fri, 17 Nov 2017 05:20:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFdkg-0006DM-AW for guix-patches@gnu.org; Fri, 17 Nov 2017 05:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFdkg-0000zf-16 for guix-patches@gnu.org; Fri, 17 Nov 2017 05:20:02 -0500 Subject: [bug#27083] screen-lockers: i3lock-color and i3lock-fancy Resent-Message-ID: Date: Fri, 17 Nov 2017 10:18:35 +0000 From: ng0 Message-ID: <20171117101835.whd5f7lincppxlgy@abyayala> References: <871skx9ql3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7hxhkvtcjaih5ibp" Content-Disposition: inline In-Reply-To: <871skx9ql3.fsf@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Chris Marusich Cc: 27083@debbugs.gnu.org --7hxhkvtcjaih5ibp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Chris, thanks for your input. I think I was just stuck by too many repetive attempts. Thanks for a fresh view :) I'll send applied changes as soon as I can (probably next week). Chris Marusich transcribed 11K bytes: > writes: >=20 > > I have no idea about the error of i3lock-fancy (password is not > > accepted). An commented phase in i3lock-color is still included where > > I tried to fix this, but I don't know much about PAM at this point. >=20 > When I checked using "guix system vm", the reason i3lock refused to > accept the password was because it could not read /etc/shadow. One > solution to this problem is to do both of the following: >=20 > 1) Do not wrap i3lock in a wrapper script. >=20 > 2) Install the i3lock executable as setuid-root. Oh, 2 was what I was thinking of that might fix it. I just had no time to test it. > When installing i3lock as a setuid-root program, it is important not to > wrap it in a script. It is common in UNIX-like systems to ignore the > setuid bit when the program is an interpreted script instead of an > executable (a simple Internet search for a phrase like "setuid bash > script" will provide lots of supporting information about this). If you > do (2) without also removing the wrapping logic that you put into the > package definition, you will find that i3lock still rejects your > password - this is because it still can't read /etc/shadow. >=20 > The attached patch is a revised version of your first patch to add > i3lock-color. I have basically just removed the wrapping phase. To > install it setuid-root along with an appropriate PAM configuration file, > just add a screen-locker service like the following to your services in > your operating system declaration: >=20 > (screen-locker-service i3lock-color "i3lock") >=20 > Note that this will create an appropriate PAM configuration file at > /etc/pam.d/i3lock, so you don't need to bother messing around with the > PAM configuration file that comes with i3lock-color. >=20 > I haven't looked at the fancy version yet. I'll check it out when I get > a little more time. The fancy version is basically a fork with some more fancy visual elements. It should be similar. > > + %D%/packages/patches/hypre-doc-tables.patch \ > > + %D%/packages/patches/hypre-ldflags.patch \ >=20 > Did you intend to include these in the patch? They aren't used, so I've > removed them in my version of the patch. Many weeks ago, I don't know what happened there. Maybe a mistake in rebase. > > +--- > > + Makefile | 7 +------ > > + 1 file changed, 1 insertion(+), 6 deletions(-) > > + > > +diff --git a/Makefile b/Makefile > > +index c0fe888..b4b6cd9 100644 > > +--- a/Makefile > > ++++ b/Makefile > > +@@ -6,11 +6,6 @@ SYSCONFDIR=3D/etc > > + PKG_CONFIG=3Dpkg-config > > + MANDIR=3D/usr/share/man > > +=20 > > +-# Check if pkg-config is installed, we need it for building CFLAGS/LI= BS > > +-ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null 1>/dev/null || echo 1),= 1) > > +-$(error "$(PKG_CONFIG) was not found") > > +-endif > > +- > > + CFLAGS +=3D -std=3Dc99 > > + CFLAGS +=3D -pipe > > + CFLAGS +=3D -Wall > > +@@ -18,7 +13,7 @@ CFLAGS +=3D -O2 > > + SIMD_CFLAGS +=3D -funroll-loops > > + SIMD_CFLAGS +=3D -msse2 > > + CPPFLAGS +=3D -D_GNU_SOURCE > > +-CPPFLAGS +=3D -DXKBCOMPOSE=3D$(shell if test -e /usr/include/xkbcommo= n/xkbcommon-compose.h ; then echo 1 ; else echo 0 ; fi ) > > ++CPPFLAGS +=3D -DXKBCOMPOSE=3D1 > > + CFLAGS +=3D $(shell $(PKG_CONFIG) --cflags cairo xcb-composite xcb-xi= nerama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11) > > + LIBS +=3D $(shell $(PKG_CONFIG) --libs cairo xcb-composite xcb-xinera= ma xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11) > > + LIBS +=3D -lpam > > +--=20 > > +2.13.0 >=20 > FYI, it looks like maybe we could probably remove this patch file > entirely, and just use substitute* to modify the Makefile, if we > provided the "which" program as an input. Specifically, if the which > program were present, then probably the check you removed would > succeed. I haven't tried it myself, though. Okay, I will give it a try. > > -;;; Copyright (c) 2016, 2017 ng0 > > +;;; Copyright (c) 2016, 2017 ng0 >=20 > FYI, the contact.ng0@cryptolab.net email address is still mentioned in > multiple other files, too. Yes. I'm only changing addresses once I touch the file. So old addresses might be in there for a long time. Otoh, I will prepare a patch and change all my header addresses. > > + (description > > + "I3lock-color is a screen locker. It is a re-patched version of > > +i3lock, which is a simple screen locker like slock. Features include: > > + > > +@enumerate > > +@item forking process, the locked screen is preserved when you suspend= from RAM > > +@item specify background color or PNG image to be displayed in the loc= k screen > > +@item many additional color options > > +@end enumerate\n") >=20 > I'm not sure if the trailing newline is necessary. Unless you beat me > to it, I'll check on this detail the next time I return to this thread. I've seen this multiple times before and have just followed this style. > --=20 > Chris > From 53edb9d43966ec9fbea8292608875d0c894adaea Mon Sep 17 00:00:00 2001 > From: ng0 > Date: Fri, 17 Nov 2017 01:38:14 -0800 > Subject: [PATCH] gnu: Add i3lock-color. >=20 > * gnu/local.mk (dist_patch_DATA): Add i3lock-color-fix-makefile.patch. > * gnu/packages/patches/i3lock-color-fix-makefile.patch: New file. > * gnu/packages/wm.scm: Add i3lock-color. >=20 > Signed-off-by: Chris Marusich > --- > gnu/local.mk | 1 + > .../patches/i3lock-color-fix-makefile.patch | 38 +++++++++++++ > gnu/packages/wm.scm | 66 ++++++++++++++++= ++++++ > 3 files changed, 105 insertions(+) > create mode 100644 gnu/packages/patches/i3lock-color-fix-makefile.patch >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index 61bebe662..575d88506 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -738,6 +738,7 @@ dist_patch_DATA =3D \ > %D%/packages/patches/hubbub-sort-entities.patch \ > %D%/packages/patches/hurd-fix-eth-multiplexer-dependency.patch \ > %D%/packages/patches/hydra-disable-darcs-test.patch \ > + %D%/packages/patches/i3lock-color-fix-makefile.patch \ > %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ > %D%/packages/patches/icu4c-CVE-2017-7867-CVE-2017-7868.patch \ > %D%/packages/patches/icu4c-CVE-2017-14952.patch \ > diff --git a/gnu/packages/patches/i3lock-color-fix-makefile.patch b/gnu/p= ackages/patches/i3lock-color-fix-makefile.patch > new file mode 100644 > index 000000000..8243dc548 > --- /dev/null > +++ b/gnu/packages/patches/i3lock-color-fix-makefile.patch > @@ -0,0 +1,38 @@ > +From eaca36ed78bafb82bd51a9e83c6445ef8f1698c8 Mon Sep 17 00:00:00 2001 > +From: ng0 > +Date: Mon, 22 May 2017 18:22:19 +0000 > +Subject: [PATCH] This fix to the Makefile is required to make i3lock-col= or > + build on Guix. > + > +--- > + Makefile | 7 +------ > + 1 file changed, 1 insertion(+), 6 deletions(-) > + > +diff --git a/Makefile b/Makefile > +index c0fe888..b4b6cd9 100644 > +--- a/Makefile > ++++ b/Makefile > +@@ -6,11 +6,6 @@ SYSCONFDIR=3D/etc > + PKG_CONFIG=3Dpkg-config > + MANDIR=3D/usr/share/man > +=20 > +-# Check if pkg-config is installed, we need it for building CFLAGS/LIBS > +-ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null 1>/dev/null || echo 1),1) > +-$(error "$(PKG_CONFIG) was not found") > +-endif > +- > + CFLAGS +=3D -std=3Dc99 > + CFLAGS +=3D -pipe > + CFLAGS +=3D -Wall > +@@ -18,7 +13,7 @@ CFLAGS +=3D -O2 > + SIMD_CFLAGS +=3D -funroll-loops > + SIMD_CFLAGS +=3D -msse2 > + CPPFLAGS +=3D -D_GNU_SOURCE > +-CPPFLAGS +=3D -DXKBCOMPOSE=3D$(shell if test -e /usr/include/xkbcommon/= xkbcommon-compose.h ; then echo 1 ; else echo 0 ; fi ) > ++CPPFLAGS +=3D -DXKBCOMPOSE=3D1 > + CFLAGS +=3D $(shell $(PKG_CONFIG) --cflags cairo xcb-composite xcb-xine= rama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11) > + LIBS +=3D $(shell $(PKG_CONFIG) --libs cairo xcb-composite xcb-xinerama= xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11) > + LIBS +=3D -lpam > +--=20 > +2.13.0 > + > diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm > index 09c10eaa0..3d5a0ef7a 100644 > --- a/gnu/packages/wm.scm > +++ b/gnu/packages/wm.scm > @@ -66,6 +66,7 @@ > #:use-module (gnu packages gperf) > #:use-module (gnu packages imagemagick) > #:use-module (gnu packages lua) > + #:use-module (gnu packages linux) > #:use-module (gnu packages suckless) > #:use-module (guix download) > #:use-module (guix git-download)) > @@ -333,6 +334,71 @@ and locate windows on all your workspaces, using an = interactive dmenu > prompt.") > (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/"= ))))) > =20 > +;; The last release is from 2015, use the git commit. > +(define-public i3lock-color > + (let ((commit "275ff68f6a6b7985c65fbaac537f4c018b47942f") > + (revision "1")) > + (package > + (name "i3lock-color") > + (version (string-append "2.8-" revision "." (string-take commit 7))) > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/chrjguill/i3lock-color") > + (commit commit))) > + (file-name (string-append name "-" version "-checkout")) > + (snippet > + ;; The Makefile is read-only, we are going to patch it. > + '(chmod "Makefile" #o755)) > + (patches (search-patches "i3lock-color-fix-makefile.patch")) > + (sha256 > + (base32 > + "1qhxqj1gwmf473b4b1bfqxdxiw1y6gq9rf97d77jc9s9z267fjm5")))) > + (build-system gnu-build-system) > + (arguments > + `(#:tests? #f ; No tests included. > + #:make-flags (list "CC=3Dgcc") > + #:phases > + (modify-phases %standard-phases > + (replace 'configure > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (man (string-append out "/share/man")) > + (etc (string-append out "/etc"))) > + (substitute* "Makefile" > + (("PREFIX=3D/usr") > + (string-append "PREFIX=3D" out)) > + (("SYSCONFDIR=3D/etc") > + (string-append "SYSCONFDIR=3D" etc)) > + (("MANDIR=3D/usr/share/man") > + (string-append "MANDIR=3D" man))) > + #t)))))) > + (inputs > + `(("xcb-util-image" ,xcb-util-image) > + ("xcb-util-keysyms" ,xcb-util-keysyms) > + ("xcb-util" ,xcb-util) > + ("libxcb" ,libxcb) > + ("linux-pam" ,linux-pam) > + ("libev" ,libev) > + ("libx11" ,libx11) > + ("cairo" ,cairo))) > + (native-inputs > + `(("libxkbcommon" ,libxkbcommon) > + ("pkg-config" ,pkg-config))) > + (home-page "https://github.com/chrjguill/i3lock-color") > + (synopsis "Screenlocker with color configuration support") > + (description > + "I3lock-color is a screen locker. It is a re-patched version of > +i3lock, which is a simple screen locker like slock. Features include: > + > +@enumerate > +@item forking process, the locked screen is preserved when you suspend f= rom RAM > +@item specify background color or PNG image to be displayed in the lock = screen > +@item many additional color options > +@end enumerate\n") > + (license license:bsd-3)))) > + > (define-public xmonad > (package > (name "xmonad") > --=20 > 2.14.2 >=20 --=20 GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588 GnuPG: https://dl.n0.is/dist/keys/ WWW: https://we.make.ritual.n0.is --7hxhkvtcjaih5ibp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEqIyK3RKYKNfqwC5S4i+bv+40hYgFAloOt3sACgkQ4i+bv+40 hYh46g/+I/ZqzBse72vgemdsf/FdX1JWKzdSWtz+wBrxSl5fLHmj32IWA1818of4 icgfEYPa7KBA9+3S3OaZ5JZ2Gv7j6DRkwLugWFpItZQac7F2oBmH8yM4mBJisZVo YjV99N37nDgw4HW5f/ybzz1ZyujCTaJ6WuJ/D0t3kkWKuC4+qecrcX9OGH6Gb4RT D3oCt+RcmAcafo29jOREfClXXuBGC1wUtnC5xc9fyNTYPAkVNxUa8yoLo5dHz27r YnjbAY+cTObnGtRo/J+nxJSj5k8J/NIKsEfLVN4kuz8cRFR/sScXHGaLFKblK7ng ixVlUsISGQX+zRokiBm6TRcOfQSDEzdeYgwYX0UKKth54nhqqQt0UFrlCs63Xyq1 UiN1ha7dGdKiPHG2bGHcSl2QVuxnY9fRu1kUzV51s9X5IgpUFal3/RdkhMjP3TYx 8QNzDtuEnb5zgaaFtnCq+QWqd0zqeUAqxhCdVPe8GJlvvJINYIfATaknzLFhsKbG wE6SXaxghzXjRUpdhXIUvd7ROpKlecVufhCiwit1d46ScYtUHwPPLWqF3oqOknDz lPXyeh7DreGByTzPRbJQfB46EdKOGP7boQbAt4JTgJjBKlTrk09Qx2YhRQlDz2I4 fgxDaDqSsqy5T6stz5XNbglJe6OBMotPKwyJlvP9EznIKER81qc= =VS6M -----END PGP SIGNATURE----- --7hxhkvtcjaih5ibp--