Bugzilla – Attachment 2811 Details for
Bug 1988
ControlPersist causes stderr to be left open until the master connection times out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
close ControlPersist stderr when logging to file/syslog or when not in debug mode (v2)
bz1988.diff (text/plain), 1.06 KB, created by
Damien Miller
on 2016-04-28 23:34:50 AEST
(
hide
)
Description:
close ControlPersist stderr when logging to file/syslog or when not in debug mode (v2)
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2016-04-28 23:34:50 AEST
Size:
1.06 KB
patch
obsolete
>diff --git a/log.c b/log.c >index a5ba22f..9011f9d 100644 >--- a/log.c >+++ b/log.c >@@ -308,7 +308,7 @@ log_change_level(LogLevel new_log_level) > int > log_is_on_stderr(void) > { >- return log_on_stderr; >+ return log_on_stderr && log_stderr_fd == STDERR_FILENO; > } > > /* redirect what would usually get written to stderr to specified file */ >diff --git a/ssh.c b/ssh.c >index ec8a515..65e0217 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -1346,7 +1346,7 @@ static void > control_persist_detach(void) > { > pid_t pid; >- int devnull; >+ int devnull, keep_stderr; > > debug("%s: backgrounding master process", __func__); > >@@ -1377,8 +1377,10 @@ control_persist_detach(void) > error("%s: open(\"/dev/null\"): %s", __func__, > strerror(errno)); > } else { >+ keep_stderr = log_is_on_stderr() && debug_flag; > if (dup2(devnull, STDIN_FILENO) == -1 || >- dup2(devnull, STDOUT_FILENO) == -1) >+ dup2(devnull, STDOUT_FILENO) == -1 || >+ (!keep_stderr && dup2(devnull, STDERR_FILENO) == -1)) > error("%s: dup2: %s", __func__, strerror(errno)); > if (devnull > STDERR_FILENO) > close(devnull);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1988
:
2299
|
2810
| 2811 |
3409