diff options
author | Thomas Klausner <wiz@NetBSD.org> | 2015-02-25 22:22:50 +0100 |
---|---|---|
committer | Thomas Klausner <wiz@NetBSD.org> | 2015-02-28 18:19:52 +0100 |
commit | 6c335e1c315a68283b1303afb06a3d5a34adab83 (patch) | |
tree | d2b09dcf66bbae97a29130ee2d9ed3e731053f57 /auth.c | |
parent | 0caed2fbce401e48d55ebfeda968e9ea8012f01d (diff) |
Close file descriptors on exec.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -156,24 +156,28 @@ SetAuthentication(int count, IceListenObj *listenObjs, if (!(addfp = fopen (addAuthFile, "w"))) goto bad; + fcntl(fileno(addfp), F_SETFD, FD_CLOEXEC); if ((remAuthFile = unique_filename (path, ".xsm")) == NULL) goto bad; if (!(removefp = fopen (remAuthFile, "w"))) goto bad; + fcntl(fileno(removefp), F_SETFD, FD_CLOEXEC); #else if ((addAuthFile = unique_filename (path, ".xsm", &fd)) == NULL) goto bad; if (!(addfp = fdopen(fd, "wb"))) goto bad; + fcntl(fileno(addfp), F_SETFD, FD_CLOEXEC); if ((remAuthFile = unique_filename (path, ".xsm", &fd)) == NULL) goto bad; if (!(removefp = fdopen(fd, "wb"))) goto bad; + fcntl(fileno(removefp), F_SETFD, FD_CLOEXEC); #endif if ((*authDataEntries = (IceAuthDataEntry *) XtMalloc ( |