forked from pool/systemd
20 lines
918 B
Diff
20 lines
918 B
Diff
|
---
|
||
|
src/login/pam_systemd.c | 6 +++++-
|
||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||
|
|
||
|
--- src/login/pam_systemd.c
|
||
|
+++ src/login/pam_systemd.c 2015-07-29 08:52:20.762018565 +0000
|
||
|
@@ -507,7 +507,11 @@ _public_ PAM_EXTERN int pam_sm_open_sess
|
||
|
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.");
|
||
|
- safe_close(session_fd);
|
||
|
+ if (session_fd >= 0) {
|
||
|
+ PROTECT_ERRNO;
|
||
|
+ if (_unlikely_(!(close_nointr(session_fd) != -EBADF)))
|
||
|
+ pam_syslog(handle, LOG_ERR, "Unexpected error code on closing session fd: %m");
|
||
|
+ }
|
||
|
return r;
|
||
|
}
|
||
|
}
|