comparison svr-runopts.c @ 1557:61a793b6e471 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Feb 2018 21:28:59 +0800
parents bb8eaa26bc93 1acbdf64088e
children 0dc3103a5900
comparison
equal deleted inserted replaced
1546:bb8eaa26bc93 1557:61a793b6e471
68 #endif 68 #endif
69 #if DO_MOTD 69 #if DO_MOTD
70 "-m Don't display the motd on login\n" 70 "-m Don't display the motd on login\n"
71 #endif 71 #endif
72 "-w Disallow root logins\n" 72 "-w Disallow root logins\n"
73 #ifdef HAVE_GETGROUPLIST
73 "-G Restrict logins to members of specified group\n" 74 "-G Restrict logins to members of specified group\n"
75 #endif
74 #if DROPBEAR_SVR_PASSWORD_AUTH || DROPBEAR_SVR_PAM_AUTH 76 #if DROPBEAR_SVR_PASSWORD_AUTH || DROPBEAR_SVR_PAM_AUTH
75 "-s Disable password logins\n" 77 "-s Disable password logins\n"
76 "-g Disable password logins for root\n" 78 "-g Disable password logins for root\n"
77 "-B Allow blank password logins\n" 79 "-B Allow blank password logins\n"
78 #endif 80 #endif
133 svr_opts.bannerfile = NULL; 135 svr_opts.bannerfile = NULL;
134 svr_opts.banner = NULL; 136 svr_opts.banner = NULL;
135 svr_opts.forced_command = NULL; 137 svr_opts.forced_command = NULL;
136 svr_opts.forkbg = 1; 138 svr_opts.forkbg = 1;
137 svr_opts.norootlogin = 0; 139 svr_opts.norootlogin = 0;
140 #ifdef HAVE_GETGROUPLIST
138 svr_opts.restrict_group = NULL; 141 svr_opts.restrict_group = NULL;
139 svr_opts.restrict_group_gid = 0; 142 svr_opts.restrict_group_gid = 0;
143 #endif
140 svr_opts.noauthpass = 0; 144 svr_opts.noauthpass = 0;
141 svr_opts.norootpass = 0; 145 svr_opts.norootpass = 0;
142 svr_opts.allowblankpass = 0; 146 svr_opts.allowblankpass = 0;
143 svr_opts.maxauthtries = MAX_AUTH_TRIES; 147 svr_opts.maxauthtries = MAX_AUTH_TRIES;
144 svr_opts.inetdmode = 0; 148 svr_opts.inetdmode = 0;
233 break; 237 break;
234 #endif 238 #endif
235 case 'w': 239 case 'w':
236 svr_opts.norootlogin = 1; 240 svr_opts.norootlogin = 1;
237 break; 241 break;
242 #ifdef HAVE_GETGROUPLIST
238 case 'G': 243 case 'G':
239 next = &svr_opts.restrict_group; 244 next = &svr_opts.restrict_group;
240 break; 245 break;
246 #endif
241 case 'W': 247 case 'W':
242 next = &recv_window_arg; 248 next = &recv_window_arg;
243 break; 249 break;
244 case 'K': 250 case 'K':
245 next = &keepalive_arg; 251 next = &keepalive_arg;
338 svr_opts.bannerfile); 344 svr_opts.bannerfile);
339 } 345 }
340 buf_setpos(svr_opts.banner, 0); 346 buf_setpos(svr_opts.banner, 0);
341 } 347 }
342 348
349 #ifdef HAVE_GETGROUPLIST
343 if (svr_opts.restrict_group) { 350 if (svr_opts.restrict_group) {
344 struct group *restrictedgroup = getgrnam(svr_opts.restrict_group); 351 struct group *restrictedgroup = getgrnam(svr_opts.restrict_group);
345 352
346 if (restrictedgroup){ 353 if (restrictedgroup){
347 svr_opts.restrict_group_gid = restrictedgroup->gr_gid; 354 svr_opts.restrict_group_gid = restrictedgroup->gr_gid;
348 } else { 355 } else {
349 dropbear_exit("Cannot restrict logins to group '%s' as the group does not exist", svr_opts.restrict_group); 356 dropbear_exit("Cannot restrict logins to group '%s' as the group does not exist", svr_opts.restrict_group);
350 } 357 }
351 358 }
352 } 359 #endif
353 360
354 if (recv_window_arg) { 361 if (recv_window_arg) {
355 opts.recv_window = atol(recv_window_arg); 362 opts.recv_window = atol(recv_window_arg);
356 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) { 363 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) {
357 dropbear_exit("Bad recv window '%s'", recv_window_arg); 364 dropbear_exit("Bad recv window '%s'", recv_window_arg);