Summary: | console login no longer possible when PAM_SESSION_ERR condition is triggered | ||
---|---|---|---|
Product: | systemd | Reporter: | Michael Biebl <mbiebl> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
Severity: | major | ||
Priority: | medium | CC: | michael+freedesktop |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | simulate error condition in pam_systemd |
Description
Michael Biebl
2013-07-25 03:16:29 UTC
Fedora has a leading '-', doesn't that make a difference? -session optional pam_systemd.so (In reply to comment #1) > Fedora has a leading '-', doesn't that make a difference? > -session optional pam_systemd.so No, doesn't make a difference. Aside from the fact, that "-" is a Fedora specific, afaik what it does is ignore errors if the .so itself does not exist. Some debugging revealed: With mbiebl’s patch (http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=15;filename=pam-systemd-session-err.patch;att=1;bug=717772 ), you can still log in when removing these two lines: if (session_fd >= 0) close_nointr_nofail(session_fd); Therefore, we think what happens is that logind creates the session, pam_systemd fails to parse the reply, closes the fd and logind kills the session, leading to that process being killed and the login terminating. To double-check, I used pam_debug in this way: session optional pam_debug.so open_session=session_err Which works fine. It’s not the return code of the module, it’s the close() of the file descriptor. I propose changing the code so that it won’t close the file descriptor at all. Even though sessions will pile up and not work as expected, you will still be able to log in, which is important. What do you think? (In reply to comment #3) > I propose changing the code so that it won’t close the file descriptor at > all. Even though sessions will pile up and not work as expected, you will > still be able to log in, which is important. What do you think? Does logind provide an API which allows one to tear down a session without killing all its processes? (In reply to comment #4) > (In reply to comment #3) > > I propose changing the code so that it won’t close the file descriptor at > > all. Even though sessions will pile up and not work as expected, you will > > still be able to log in, which is important. What do you think? > > Does logind provide an API which allows one to tear down a session without > killing all its processes? From looking at http://www.freedesktop.org/wiki/Software/systemd/logind/ I would say no, it does not. Also note that the code path we are talking about is entered (amongst other conditions) when the code cannot talk to logind, so depending on logind for the error handling seems wrong :). Lennart, Kay, what do you think with regards to comment #3? This was fixed quite some time back. Closing. (In reply to Lennart Poettering from comment #6) > This was fixed quite some time back. Closing. Which version/commit fixed this? |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.