diff options
-rw-r--r-- | auth.c | 4 | ||||
-rw-r--r-- | choose.c | 2 | ||||
-rw-r--r-- | lock.c | 1 | ||||
-rw-r--r-- | remote.c | 3 | ||||
-rw-r--r-- | restart.c | 1 | ||||
-rw-r--r-- | saveutil.c | 3 |
6 files changed, 13 insertions, 1 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 ( @@ -98,6 +98,8 @@ GetSessionNames(int *count_ret, String **short_names_ret, if ((dir = opendir (path)) == NULL) return 0; + fcntl(dirfd(dir), F_SETFD, FD_CLOEXEC); + count = 0; while ((entry = readdir (dir)) != NULL) @@ -121,6 +121,7 @@ GetLockId(const char *session_name) { return (NULL); } + fcntl(fileno(fp), F_SETFD, FD_CLOEXEC); buf[0] = '\0'; fscanf (fp, "%255s\n", buf); @@ -111,7 +111,8 @@ remote_start(const char *restart_protocol, const char *restart_machine, default: /* parent */ close (pipefd[0]); - fp = (FILE *) fdopen (pipefd[1], "w"); + fcntl(pipefd[1], F_SETFD, FD_CLOEXEC); + fp = fdopen (pipefd[1], "w"); fprintf (fp, "CONTEXT X\n"); fprintf (fp, "DIR %s\n", cwd); @@ -543,6 +543,7 @@ StartDefaultApps (void) exit (1); } } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); buf = NULL; buflen = 0; @@ -72,6 +72,7 @@ ReadSave(const char *session_name, char **sm_id) *sm_id = NULL; return 0; } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); if (verbose) printf("Reading session save file...\n"); @@ -319,6 +320,7 @@ WriteSave(const char *sm_id) } else { + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); fprintf (f, "%d\n", SAVEFILE_VERSION); fprintf (f, "%s\n", sm_id); @@ -431,6 +433,7 @@ DeleteSession(const char *session_name) if(!f) { return (0); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); buf = NULL; buflen = 0; |