From 9f369abe25277eff2be9164f032c530fd425e889 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Fri, 16 Jan 2009 02:17:57 +0100 Subject: [PATCH] added mandriva patch: subshell pty close-on-exec --- ChangeLog | 5 +++++ src/subshell.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8d196f45d..7aa18fdd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-16 Enrico Weigelt, metux IT service + + * src/subshell: setting subshell pty to close-on-exec + (taken from mandriva patches) + 2009-01-14 Slava Zanko * lib/mc.ext.in: change filemask for recognize 7z-files diff --git a/src/subshell.c b/src/subshell.c index 09c993018..8d98da539 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -1110,6 +1110,7 @@ pty_open_slave (const char *pty_name) #endif /* I_FIND && I_PUSH */ #endif /* __osf__ || __linux__ */ + fcntl(pty_slave, F_SETFD, FD_CLOEXEC); return pty_slave; } @@ -1163,6 +1164,7 @@ pty_open_slave (const char *pty_name) } if ((pty_slave = open (pty_name, O_RDWR)) == -1) fprintf (stderr, "open (pty_name, O_RDWR): %s\r\n", pty_name); + fcntl(pty_slave, F_SETFD, FD_CLOEXEC); return pty_slave; }