Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jul 2020 22:12:30 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r542450 - in head/x11/swaylock: . files
Message-ID:  <202007172212.06HMCUls032020@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Jul 17 22:12:29 2020
New Revision: 542450
URL: https://svnweb.freebsd.org/changeset/ports/542450

Log:
  x11/swaylock: unbreak PAM locking
  
  Since 1.5 it includes "login" service which doesn't ask for password
  from user running Wayland session. Before pam_authenticate(3) failed
  with PAM_AUTH_ERR due to missing permissions password database.
  
  PR:		248053
  Reported by:	many
  Submitted by:	andrew|_|tao11.riddles.org.uk, jbeich
  Tested by:	ashish

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

Modified: head/x11/swaylock/Makefile
==============================================================================
--- head/x11/swaylock/Makefile	Fri Jul 17 21:56:18 2020	(r542449)
+++ head/x11/swaylock/Makefile	Fri Jul 17 22:12:29 2020	(r542450)
@@ -2,6 +2,7 @@
 
 PORTNAME=	swaylock
 DISTVERSION=	1.5
+PORTREVISION=	1
 CATEGORIES=	x11
 
 MAINTAINER=	jbeich@FreeBSD.org
@@ -18,7 +19,7 @@ USES=		compiler:c11 gnome meson pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	swaywm
 USE_GNOME=	cairo pango
-PLIST_FILES=	bin/${PORTNAME} \
+PLIST_FILES=	"@(,,4755) bin/${PORTNAME}" \
 		etc/pam.d/${PORTNAME} \
 		share/bash-completion/completions/${PORTNAME} \
 		share/fish/vendor_completions.d/${PORTNAME}.fish \

Added: head/x11/swaylock/files/patch-pam.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/swaylock/files/patch-pam.c	Fri Jul 17 22:12:29 2020	(r542450)
@@ -0,0 +1,19 @@
+pam_unix(8) requires root priveleges to access master.passwd(5)
+
+--- pam.c.orig	2019-01-29 19:48:00 UTC
++++ pam.c
+@@ -12,12 +12,14 @@
+ static char *pw_buf = NULL;
+ 
+ void initialize_pw_backend(int argc, char **argv) {
++#ifdef __linux__
+ 	if (getuid() != geteuid() || getgid() != getegid()) {
+ 		swaylock_log(LOG_ERROR,
+ 			"swaylock is setuid, but was compiled with the PAM"
+ 			" backend. Run 'chmod a-s %s' to fix. Aborting.", argv[0]);
+ 		exit(EXIT_FAILURE);
+ 	}
++#endif
+ 	if (!spawn_comm_child()) {
+ 		exit(EXIT_FAILURE);
+ 	}

Added: head/x11/swaylock/files/patch-pam_swaylock
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/swaylock/files/patch-pam_swaylock	Fri Jul 17 22:12:29 2020	(r542450)
@@ -0,0 +1,15 @@
+"login" has "auth sufficient pam_self.so" but a screen locker is
+supposed to ask for password regardless.
+
+--- pam/swaylock.orig	2019-01-29 19:48:00 UTC
++++ pam/swaylock
+@@ -1,6 +1,6 @@
+ #
+-# PAM configuration file for the swaylock screen locker. By default, it includes
+-# the 'login' configuration file (see /etc/pam.d/login)
++# PAM configuration for the "swaylock" service. swaylock(1) only uses
++# auth facilities.
+ #
+ 
+-auth include login
++auth include system



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