summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_sepermit/pam_sepermit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/pam_sepermit/pam_sepermit.c b/modules/pam_sepermit/pam_sepermit.c
index 47f95030..0d5ab21a 100644
--- a/modules/pam_sepermit/pam_sepermit.c
+++ b/modules/pam_sepermit/pam_sepermit.c
@@ -207,6 +207,9 @@ sepermit_lock(pam_handle_t *pamh, const char *user, int debug)
return -1;
}
+ /* Need to close on exec */
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+
if (fcntl(fd, F_SETLK, &fl) == -1) {
pam_syslog(pamh, LOG_ERR, "User %s with exclusive login already logged in", user);
close(fd);