Re: sway-1.2_1 crashes

Jan Beich <[email protected]>
Newsgroups gmane.os.freebsd.devel.x11
Message-ID <[email protected]>
John Kennedy <[email protected]> writes:

> I was trying to get swaylock to work, it didn't like my password, so I
> was going to switch consoles and wack it, but it got my keyboard first.

swaylock is kinda broken on FreeBSD, see
https://github.com/swaywm/swaylock/issues/3#issuecomment-446575951

Try the following hack. I don't use swaylock myself and don't know PAM
enough (both on Linux and FreeBSD) to come up with the correct fix.

Index: x11/swaylock/Makefile
===================================================================
--- x11/swaylock/Makefile	(revision 514156)
+++ x11/swaylock/Makefile	(working copy)
@@ -2,7 +2,7 @@
 
 PORTNAME=	swaylock
 DISTVERSION=	1.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
@@ -22,7 +22,7 @@ USES=		compiler:c11 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/completions/${PORTNAME}.fish \
Index: x11/swaylock/files/patch-pam.c
===================================================================
--- x11/swaylock/files/patch-pam.c	(nonexistent)
+++ x11/swaylock/files/patch-pam.c	(working copy)
@@ -0,0 +1,17 @@
+--- 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);
+ 	}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-x11
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.