Skip to content

Commit 3ddb164

Browse files
committed
ifndef WINDOWS for utsname include/info logging
1 parent 4273dd2 commit 3ddb164

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ssh.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
#include <sys/ioctl.h>
5151
#include <sys/socket.h>
5252
#include <sys/wait.h>
53+
#ifndef WINDOWS
5354
#include <sys/utsname.h>
55+
#endif /* WINDOWS */
5456

5557
#include <ctype.h>
5658
#include <errno.h>
@@ -591,7 +593,7 @@ process_config_files(const char *host_name, struct passwd *pw,
591593
* This is not desirable. For windows, We make sure the systemwide sshd_config file is not editable by non-admin users.
592594
*/
593595
(void)read_config_file(_PATH_HOST_CONFIG_FILE, pw,
594-
host, host_name, &options, SSHCONF_CHECKPERM |
596+
host, host_name, cmd, &options, SSHCONF_CHECKPERM |
595597
(final_pass ? SSHCONF_FINAL : 0), want_final_pass);
596598
#else
597599
(void)read_config_file(_PATH_HOST_CONFIG_FILE, pw,
@@ -696,7 +698,9 @@ main(int ac, char **av)
696698
struct addrinfo *addrs = NULL;
697699
size_t n, len;
698700
u_int j;
701+
#ifndef WINDOWS
699702
struct utsname utsname;
703+
#endif /* WINDOWS */
700704
struct ssh_conn_info *cinfo = NULL;
701705

702706
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
@@ -1219,12 +1223,14 @@ main(int ac, char **av)
12191223
!use_syslog);
12201224

12211225
debug("%s, %s", SSH_RELEASE, SSH_OPENSSL_VERSION);
1226+
#ifndef WINDOWS
12221227
if (uname(&utsname) != 0) {
12231228
memset(&utsname, 0, sizeof(utsname));
12241229
strlcpy(utsname.sysname, "UNKNOWN", sizeof(utsname.sysname));
12251230
}
12261231
debug3("Running on %s %s %s %s", utsname.sysname, utsname.release,
12271232
utsname.version, utsname.machine);
1233+
#endif /* WINDOWS */
12281234
debug3("Started with: %s", args);
12291235
free(args);
12301236

sshd.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#include "openbsd-compat/sys-tree.h"
3939
#include "openbsd-compat/sys-queue.h"
4040
#include <sys/wait.h>
41+
#ifndef WINDOWS
4142
#include <sys/utsname.h>
43+
#endif /* WINDOWS */
4244

4345
#include <errno.h>
4446
#include <fcntl.h>
@@ -1424,7 +1426,9 @@ main(int ac, char **av)
14241426
struct sshkey *key;
14251427
struct sshkey *pubkey;
14261428
struct connection_info connection_info;
1427-
struct utsname utsname;
1429+
#ifndef WINDOWS
1430+
struct utsname utsname
1431+
#endif /* !WINDOWS */
14281432
sigset_t sigmask;
14291433

14301434
memset(&connection_info, 0, sizeof(connection_info));
@@ -1631,12 +1635,14 @@ main(int ac, char **av)
16311635
"test mode (-T)");
16321636

16331637
debug("sshd version %s, %s", SSH_VERSION, SSH_OPENSSL_VERSION);
1638+
#ifndef WINDOWS
16341639
if (uname(&utsname) != 0) {
16351640
memset(&utsname, 0, sizeof(utsname));
16361641
strlcpy(utsname.sysname, "UNKNOWN", sizeof(utsname.sysname));
16371642
}
16381643
debug3("Running on %s %s %s %s", utsname.sysname, utsname.release,
16391644
utsname.version, utsname.machine);
1645+
#endif /* WINDOWS */
16401646
debug3("Started with: %s", args);
16411647
free(args);
16421648

0 commit comments

Comments
 (0)