Module Name: xsrc
Committed By: snj
Date: Wed Mar 11 06:24:39 UTC 2015
Modified Files:
xsrc/external/mit/xsm/dist [netbsd-7]: auth.c choose.c lock.c remote.c
restart.c saveutil.c
Log Message:
Pull up following revision(s) (requested by mrg in ticket #583):
external/mit/xsm/dist/choose.c: revision 1.2, 1.3
external/mit/xsm/dist/saveutil.c: revision 1.2, 1.3
external/mit/xsm/dist/auth.c: revision 1.2, 1.3
external/mit/xsm/dist/lock.c: revision 1.2, 1.3
external/mit/xsm/dist/remote.c: revision 1.2, 1.3
external/mit/xsm/dist/restart.c: revision 1.2, 1.3
set close-on-exec for all fds opened...
--
Switch to the version of the close-on-exec patch that was committed upstream.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.4.1 xsrc/external/mit/xsm/dist/auth.c \
xsrc/external/mit/xsm/dist/choose.c xsrc/external/mit/xsm/dist/lock.c \
xsrc/external/mit/xsm/dist/remote.c xsrc/external/mit/xsm/dist/restart.c \
xsrc/external/mit/xsm/dist/saveutil.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xsm/dist/auth.c
diff -u xsrc/external/mit/xsm/dist/auth.c:1.1.1.3 xsrc/external/mit/xsm/dist/auth.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/auth.c:1.1.1.3 Fri May 31 07:51:30 2013
+++ xsrc/external/mit/xsm/dist/auth.c Wed Mar 11 06:24:39 2015
@@ -156,24 +156,28 @@ SetAuthentication(int count, IceListenOb
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 (
Index: xsrc/external/mit/xsm/dist/choose.c
diff -u xsrc/external/mit/xsm/dist/choose.c:1.1.1.3 xsrc/external/mit/xsm/dist/choose.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/choose.c:1.1.1.3 Fri May 31 07:51:31 2013
+++ xsrc/external/mit/xsm/dist/choose.c Wed Mar 11 06:24:39 2015
@@ -98,6 +98,8 @@ GetSessionNames(int *count_ret, String *
if ((dir = opendir (path)) == NULL)
return 0;
+ fcntl(dirfd(dir), F_SETFD, FD_CLOEXEC);
+
count = 0;
while ((entry = readdir (dir)) != NULL)
Index: xsrc/external/mit/xsm/dist/lock.c
diff -u xsrc/external/mit/xsm/dist/lock.c:1.1.1.3 xsrc/external/mit/xsm/dist/lock.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/lock.c:1.1.1.3 Fri May 31 07:51:30 2013
+++ xsrc/external/mit/xsm/dist/lock.c Wed Mar 11 06:24:39 2015
@@ -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);
Index: xsrc/external/mit/xsm/dist/remote.c
diff -u xsrc/external/mit/xsm/dist/remote.c:1.1.1.3 xsrc/external/mit/xsm/dist/remote.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/remote.c:1.1.1.3 Fri May 31 07:51:30 2013
+++ xsrc/external/mit/xsm/dist/remote.c Wed Mar 11 06:24:39 2015
@@ -111,7 +111,8 @@ remote_start(const char *restart_protoco
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);
Index: xsrc/external/mit/xsm/dist/restart.c
diff -u xsrc/external/mit/xsm/dist/restart.c:1.1.1.3 xsrc/external/mit/xsm/dist/restart.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/restart.c:1.1.1.3 Fri May 31 07:51:30 2013
+++ xsrc/external/mit/xsm/dist/restart.c Wed Mar 11 06:24:39 2015
@@ -543,6 +543,7 @@ StartDefaultApps (void)
exit (1);
}
}
+ fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
buf = NULL;
buflen = 0;
Index: xsrc/external/mit/xsm/dist/saveutil.c
diff -u xsrc/external/mit/xsm/dist/saveutil.c:1.1.1.3 xsrc/external/mit/xsm/dist/saveutil.c:1.1.1.3.4.1
--- xsrc/external/mit/xsm/dist/saveutil.c:1.1.1.3 Fri May 31 07:51:30 2013
+++ xsrc/external/mit/xsm/dist/saveutil.c Wed Mar 11 06:24:39 2015
@@ -72,6 +72,7 @@ ReadSave(const char *session_name, char
*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;