fix parsing command-line args and add Windows #ifdef to prevent in future

This commit is contained in:
Tess Gauthier 2023-08-23 13:24:36 -04:00
parent 0db6f3e486
commit a1999590a8
1 changed files with 8 additions and 1 deletions

9
sshd.c
View File

@ -2030,8 +2030,13 @@ main(int ac, char **av)
initialize_server_options(&options);
/* Parse command-line arguments. */
#ifdef WINDOWS
while ((opt = getopt(ac, av,
"C:E:b:c:f:g:h:k:o:p:u:46DGQRTdeiqrtV")) != -1) {
"C:E:b:c:f:g:h:k:o:p:u:46DGQRTdeiqrtVyz")) != -1) {
#else
while ((opt = getopt(ac, av,
"C:E:b:c:f:g:h:k:o:p:u:46DGQRTdeiqrtV")) != -1) {
#endif /* WINDOWS */
switch (opt) {
case '4':
options.address_family = AF_INET;
@ -2139,6 +2144,7 @@ main(int ac, char **av)
fprintf(stderr, "%s, %s\n",
SSH_VERSION, SSH_OPENSSL_VERSION);
exit(0);
#ifdef WINDOWS
case 'y':
privsep_unauth_child = 1;
rexec_flag = 0;
@ -2151,6 +2157,7 @@ main(int ac, char **av)
logfile = NULL;
//Sleep(10 * 1000);
break;
#endif /* WINDOWS */
default:
usage();
break;