diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-06-24 22:55:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-24 22:55:39 +0200 |
commit | 21c390ccd1b4f7bc962c16549df929ad518a1d37 (patch) | |
tree | 68458572b17f28cd20ea560216f0eea668cefddc /src/pam-module.c | |
parent | 0771475394887e3635e67196fa6f56486fa2126c (diff) |
logind: properly handle if two session with identical loginuids are attempted to be created
Diffstat (limited to 'src/pam-module.c')
-rw-r--r-- | src/pam-module.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pam-module.c b/src/pam-module.c index dc7c00166e..eba59f65f2 100644 --- a/src/pam-module.c +++ b/src/pam-module.c @@ -457,10 +457,12 @@ _public_ PAM_EXTERN int pam_sm_open_session( goto finish; } - r = pam_set_data(handle, "systemd.session-fd", INT_TO_PTR(session_fd+1), NULL); - if (r != PAM_SUCCESS) { - pam_syslog(handle, LOG_ERR, "Failed to install session fd."); - return r; + if (session_fd >= 0) { + r = pam_set_data(handle, "systemd.session-fd", INT_TO_PTR(session_fd+1), NULL); + if (r != PAM_SUCCESS) { + pam_syslog(handle, LOG_ERR, "Failed to install session fd."); + return r; + } } session_fd = -1; |