Bug 266899 - x11/lightdm: update to 1.32.0 breaks autologin
Summary: x11/lightdm: update to 1.32.0 breaks autologin
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-08 06:32 UTC by Daniel Tameling
Modified: 2022-10-08 13:36 UTC (History)
2 users (show)

See Also:
madpilot: maintainer-feedback+
madpilot: merge-quarterly+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tameling 2022-10-08 06:32:52 UTC
Upstream added the following two lines to /usr/local/etc/pam.d/lightdm-autologin:

# Block login if shell in nologin or false
auth      required pam_succeed_if.so shell notin /sbin/nologin:/usr/sbin/nologin:/bin/false:/usr/bin/false

When I comment this out, autologin works again. I got the cause of the problem and the solution from https://forums.freebsd.org/threads/freebsd-13-1-lightdm-1-32-user-autologin.86503/.
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2022-10-08 09:06:10 UTC
Hi!

Thanks for reporting this here, and good catch.

For a little context, yes, FreeBSD does not have pam_succeed_if as you have discovered.

The offending line was added upstream here:

https://github.com/canonical/lightdm/commit/0c21d986ff3c9ec1568b681c746e30b6fd25d5cb

The port was already patching the lightdm-autologin file, but the patch was not addr4essing this new line added at the top of it. This addition also did not cause the patching to fail (which could have made the offending change more easily noticeable).

Removing the line looks like the easiest solution and also mostly correct.

The pam_succeed_if functionality could be emulated using pam_exec(8), but it looks overkill, IMHO.

I'm going to test a little before committing.

This is eligible to be merged to quarterly too.
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-10-08 13:34:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6cd9fcbb0f03e95189a5eba168af7fcaead34dc1

commit 6cd9fcbb0f03e95189a5eba168af7fcaead34dc1
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-10-08 13:30:56 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-10-08 13:30:56 +0000

    x11/lightdm: Fix autologin

    Upstreaam added a pam directive using a pam module not present in FreeBSD:

    https://github.com/canonical/lightdm/commit/0c21d986ff3c9ec1568b681c746e30b6fd25d5cb

    Fix by updating the patch to remove this addition.

    PR:             266899
    MFH:            2022Q4

 x11/lightdm/Makefile                               | 1 +
 x11/lightdm/files/patch-data_pam_lightdm-autologin | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-10-08 13:35:17 UTC
A commit in branch 2022Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4c69af0fae5304884a6abeeea859e55bc8b152e0

commit 4c69af0fae5304884a6abeeea859e55bc8b152e0
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-10-08 13:30:56 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-10-08 13:34:18 +0000

    x11/lightdm: Fix autologin

    Upstreaam added a pam directive using a pam module not present in FreeBSD:

    https://github.com/canonical/lightdm/commit/0c21d986ff3c9ec1568b681c746e30b6fd25d5cb

    Fix by updating the patch to remove this addition.

    PR:             266899
    MFH:            2022Q4
    (cherry picked from commit 6cd9fcbb0f03e95189a5eba168af7fcaead34dc1)

 x11/lightdm/Makefile                               | 1 +
 x11/lightdm/files/patch-data_pam_lightdm-autologin | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2022-10-08 13:36:01 UTC
Fix committed and merged. Thanks!