From owner-freebsd-x11@freebsd.org Thu Oct 10 19:04:20 2019 Return-Path: Delivered-To: freebsd-x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91742147113 for ; Thu, 10 Oct 2019 19:04:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46q0r43L0cz4SbY; Thu, 10 Oct 2019 19:04:20 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 6B9C1143CB; Thu, 10 Oct 2019 19:04:20 +0000 (UTC) From: Jan Beich To: John Kennedy Cc: freebsd-x11@freebsd.org Subject: Re: sway-1.2_1 crashes References: <20191007165337.GA85696@phouka1.phouka.net> <20191007232340.GB85696@phouka1.phouka.net> <20191008172007.GA89365@phouka1.phouka.net> <20191010182705.GC46984@phouka1.phouka.net> Date: Thu, 10 Oct 2019 21:04:16 +0200 In-Reply-To: <20191010182705.GC46984@phouka1.phouka.net> (John Kennedy's message of "Thu, 10 Oct 2019 11:27:05 -0700") Message-ID: <8sps-o21b-wny@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2019 19:04:20 -0000 John Kennedy 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); + }