summaryrefslogtreecommitdiff
path: root/modules/pam_sepermit/pam_sepermit.c
diff options
context:
space:
mode:
authorTomas Mraz <tm@t8m.info>2008-03-31 10:31:50 +0000
committerTomas Mraz <tm@t8m.info>2008-03-31 10:31:50 +0000
commitd07b392cdb5b264d21c6a64753957710b3ec921c (patch)
tree663f770e738c5a5c9c96a1196392e74faca38705 /modules/pam_sepermit/pam_sepermit.c
parent663645b36bf6fd89b1e37629be90aaaa42f2bd02 (diff)
Relevant BUGIDs:
Purpose of commit: bugfix Commit summary: --------------- 2008-03-31 Dan Walsh <dwalsh@redhat.com> * modules/pam_sepermit/pam_sepermit.c(sepermit_lock): Mark lock fd to be closed on exec.
Diffstat (limited to 'modules/pam_sepermit/pam_sepermit.c')
-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);