[Bug 279268] [patch] xdm dies when pressing CTRL-C if pam_xdg.so is used

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 24 May 2024 08:36:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279268

            Bug ID: 279268
           Summary: [patch] xdm dies when pressing CTRL-C if pam_xdg.so is
                    used
           Product: Base System
           Version: 14.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: mail@fbsd2.e4m.org

Created attachment 250918
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=250918&action=edit
patch

After updating to latest 14.1 BETA xdm crashed when Ctrl-C was pressed on the
logon screen. Running xdm in debug mode showed:

SetPrompt(0, <NULL>, LOGIN_PROMPT_NOT_SHOWN(0))
SetPrompt(1, <NULL>, LOGIN_PROMPT_NOT_SHOWN(0))
pam_msg: PAM_PROMPT_ECHO_ON (2): '       Login:'
SetPrompt(0,        Login:, LOGIN_PROMPT_ECHO_ON(1))
RedrawFail('Login incorrect or forbidden by policy', 0)
dispatching :0
RedrawFail('Login incorrect or forbidden by policy', 0)

(CTRL-C now)

GreetDone: , (password is 0 long)
REMANAGE_DISPLAY
Done dispatch :0
xdm error (pid 8751): pam_authenticate failure: Conversation failure
Unsecure display :0
Greet connection closed
Manager wait returns pid: 8751 sig 11 core 0 code 0
Display exited with unknown status 2816

I fixed it with the attached patch (not knowing if this is correct :-)).
Apparently pam_get_item() can return NULL in &user but pam_xdg.c continues with
it...

-- 
You are receiving this mail because:
You are the assignee for the bug.