version 1.77, 2001/04/13 22:46:53 |
version 1.78, 2001/04/15 21:28:35 |
|
|
if (strcasecmp(cp, keywords[i].name) == 0) |
if (strcasecmp(cp, keywords[i].name) == 0) |
return keywords[i].opcode; |
return keywords[i].opcode; |
|
|
fprintf(stderr, "%s: line %d: Bad configuration option: %s\n", |
error("%s: line %d: Bad configuration option: %s", |
filename, linenum, cp); |
filename, linenum, cp); |
return sBadOption; |
return sBadOption; |
} |
} |
|
|
|
|
intptr = &options->server_key_bits; |
intptr = &options->server_key_bits; |
parse_int: |
parse_int: |
arg = strdelim(&cp); |
arg = strdelim(&cp); |
if (!arg || *arg == '\0') { |
if (!arg || *arg == '\0') |
fprintf(stderr, "%s line %d: missing integer value.\n", |
fatal("%s line %d: missing integer value.", |
filename, linenum); |
filename, linenum); |
exit(1); |
|
} |
|
value = atoi(arg); |
value = atoi(arg); |
if (*intptr == -1) |
if (*intptr == -1) |
*intptr = value; |
*intptr = value; |
|
|
|
|
case sHostKeyFile: |
case sHostKeyFile: |
intptr = &options->num_host_key_files; |
intptr = &options->num_host_key_files; |
if (*intptr >= MAX_HOSTKEYS) { |
if (*intptr >= MAX_HOSTKEYS) |
fprintf(stderr, |
fatal("%s line %d: too many host keys specified (max %d).", |
"%s line %d: too many host keys specified (max %d).\n", |
|
filename, linenum, MAX_HOSTKEYS); |
filename, linenum, MAX_HOSTKEYS); |
exit(1); |
|
} |
|
charptr = &options->host_key_files[*intptr]; |
charptr = &options->host_key_files[*intptr]; |
parse_filename: |
parse_filename: |
arg = strdelim(&cp); |
arg = strdelim(&cp); |
if (!arg || *arg == '\0') { |
if (!arg || *arg == '\0') |
fprintf(stderr, "%s line %d: missing file name.\n", |
fatal("%s line %d: missing file name.", |
filename, linenum); |
filename, linenum); |
exit(1); |
|
} |
|
if (*charptr == NULL) { |
if (*charptr == NULL) { |
*charptr = tilde_expand_filename(arg, getuid()); |
*charptr = tilde_expand_filename(arg, getuid()); |
/* increase optional counter */ |
/* increase optional counter */ |
|
|
case sPermitRootLogin: |
case sPermitRootLogin: |
intptr = &options->permit_root_login; |
intptr = &options->permit_root_login; |
arg = strdelim(&cp); |
arg = strdelim(&cp); |
if (!arg || *arg == '\0') { |
if (!arg || *arg == '\0') |
fprintf(stderr, "%s line %d: missing yes/" |
fatal("%s line %d: missing yes/" |
"without-password/forced-commands-only/no " |
"without-password/forced-commands-only/no " |
"argument.\n", filename, linenum); |
"argument.", filename, linenum); |
exit(1); |
value = 0; /* silence compiler */ |
} |
|
if (strcmp(arg, "without-password") == 0) |
if (strcmp(arg, "without-password") == 0) |
value = PERMIT_NO_PASSWD; |
value = PERMIT_NO_PASSWD; |
else if (strcmp(arg, "forced-commands-only") == 0) |
else if (strcmp(arg, "forced-commands-only") == 0) |
|
|
value = PERMIT_YES; |
value = PERMIT_YES; |
else if (strcmp(arg, "no") == 0) |
else if (strcmp(arg, "no") == 0) |
value = PERMIT_NO; |
value = PERMIT_NO; |
else { |
else |
fprintf(stderr, "%s line %d: Bad yes/" |
fatal("%s line %d: Bad yes/" |
"without-password/forced-commands-only/no " |
"without-password/forced-commands-only/no " |
"argument: %s\n", filename, linenum, arg); |
"argument: %s", filename, linenum, arg); |
exit(1); |
|
} |
|
if (*intptr == -1) |
if (*intptr == -1) |
*intptr = value; |
*intptr = value; |
break; |
break; |
|
|
intptr = &options->ignore_rhosts; |
intptr = &options->ignore_rhosts; |
parse_flag: |
parse_flag: |
arg = strdelim(&cp); |
arg = strdelim(&cp); |
if (!arg || *arg == '\0') { |
if (!arg || *arg == '\0') |
fprintf(stderr, "%s line %d: missing yes/no argument.\n", |
fatal("%s line %d: missing yes/no argument.", |
filename, linenum); |
filename, linenum); |
exit(1); |
value = 0; /* silence compiler */ |
} |
|
if (strcmp(arg, "yes") == 0) |
if (strcmp(arg, "yes") == 0) |
value = 1; |
value = 1; |
else if (strcmp(arg, "no") == 0) |
else if (strcmp(arg, "no") == 0) |
value = 0; |
value = 0; |
else { |
else |
fprintf(stderr, "%s line %d: Bad yes/no argument: %s\n", |
fatal("%s line %d: Bad yes/no argument: %s", |
filename, linenum, arg); |
filename, linenum, arg); |
exit(1); |
|
} |
|
if (*intptr == -1) |
if (*intptr == -1) |
*intptr = value; |
*intptr = value; |
break; |
break; |
|
|
intptr = &options->client_alive_count_max; |
intptr = &options->client_alive_count_max; |
goto parse_int; |
goto parse_int; |
default: |
default: |
fprintf(stderr, "%s line %d: Missing handler for opcode %s (%d)\n", |
fatal("%s line %d: Missing handler for opcode %s (%d)", |
filename, linenum, arg, opcode); |
filename, linenum, arg, opcode); |
exit(1); |
|
} |
} |
if ((arg = strdelim(&cp)) != NULL && *arg != '\0') { |
if ((arg = strdelim(&cp)) != NULL && *arg != '\0') |
fprintf(stderr, |
fatal("%s line %d: garbage at end of line; \"%.200s\".", |
"%s line %d: garbage at end of line; \"%.200s\".\n", |
filename, linenum, arg); |
filename, linenum, arg); |
|
exit(1); |
|
} |
|
} |
} |
fclose(f); |
fclose(f); |
if (bad_options > 0) { |
if (bad_options > 0) |
fprintf(stderr, "%s: terminating, %d bad configuration options\n", |
fatal("%s: terminating, %d bad configuration options", |
filename, bad_options); |
filename, bad_options); |
exit(1); |
|
} |
|
} |
} |