Skip to content

Commit 75f0ebe

Browse files
committed
fix logging regression
1 parent 0fa20c7 commit 75f0ebe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sshd-session.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,6 @@ privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
10391039
close(pmonitor->m_log_sendfd);
10401040
pmonitor->m_log_sendfd = PRIVSEP_LOG_FD;
10411041
fcntl(pmonitor->m_log_sendfd, F_SETFD, FD_CLOEXEC);
1042-
10431042
/* Arrange for logging to be sent to the monitor */
10441043
set_log_handler(mm_log_handler, pmonitor);
10451044
#endif
@@ -1453,7 +1452,11 @@ main(int ac, char **av)
14531452
struct ssh *ssh = NULL;
14541453
extern char *optarg;
14551454
extern int optind;
1455+
#ifdef WINDOWS
1456+
int r, opt, on = 1, remote_port;
1457+
#else
14561458
int devnull, r, opt, on = 1, remote_port;
1459+
#endif /* WINDOWS */
14571460
int sock_in = -1, sock_out = -1, rexeced_flag = 0, have_key = 0;
14581461
const char *remote_ip, *rdomain;
14591462
char *line, *laddr, *logfile = NULL;
@@ -1645,15 +1648,15 @@ main(int ac, char **av)
16451648
#endif /* WINDOWS */
16461649

16471650
platform_pre_session_start();
1648-
1651+
#ifndef WINDOWS
16491652
/* Reserve fds we'll need later for reexec things */
16501653
if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)
16511654
fatal("open %s: %s", _PATH_DEVNULL, strerror(errno));
16521655
while (devnull < PRIVSEP_MIN_FREE_FD) {
16531656
if ((devnull = dup(devnull)) == -1)
16541657
fatal("dup %s: %s", _PATH_DEVNULL, strerror(errno));
16551658
}
1656-
1659+
#endif /* !WINDOWS */
16571660
seed_rng();
16581661

16591662
/* If requested, redirect the logs to the specified logfile. */
@@ -1732,10 +1735,11 @@ main(int ac, char **av)
17321735
*/
17331736
(void)atomicio(vwrite, startup_pipe, "\0", 1);
17341737
}
1738+
#ifndef WINDOWS
17351739
/* close the fd, but keep the slot reserved */
17361740
if (dup2(devnull, REEXEC_CONFIG_PASS_FD) == -1)
17371741
fatal("dup2 devnull->config fd: %s", strerror(errno));
1738-
1742+
#endif /* !WINDOWS */
17391743
/* Check that options are sensible */
17401744
if (options.authorized_keys_command_user == NULL &&
17411745
(options.authorized_keys_command != NULL &&

0 commit comments

Comments
 (0)