version 1.19, 1999/10/25 21:35:25 |
version 1.20, 1999/11/10 23:36:44 |
|
|
options->key_regeneration_time = -1; |
options->key_regeneration_time = -1; |
options->permit_root_login = -1; |
options->permit_root_login = -1; |
options->ignore_rhosts = -1; |
options->ignore_rhosts = -1; |
options->quiet_mode = -1; |
|
options->fascist_logging = -1; |
|
options->print_motd = -1; |
options->print_motd = -1; |
options->check_mail = -1; |
options->check_mail = -1; |
options->x11_forwarding = -1; |
options->x11_forwarding = -1; |
|
|
options->strict_modes = -1; |
options->strict_modes = -1; |
options->keepalives = -1; |
options->keepalives = -1; |
options->log_facility = (SyslogFacility)-1; |
options->log_facility = (SyslogFacility)-1; |
|
options->log_level = (LogLevel)-1; |
options->rhosts_authentication = -1; |
options->rhosts_authentication = -1; |
options->rhosts_rsa_authentication = -1; |
options->rhosts_rsa_authentication = -1; |
options->rsa_authentication = -1; |
options->rsa_authentication = -1; |
|
|
options->permit_root_login = 1; /* yes */ |
options->permit_root_login = 1; /* yes */ |
if (options->ignore_rhosts == -1) |
if (options->ignore_rhosts == -1) |
options->ignore_rhosts = 0; |
options->ignore_rhosts = 0; |
if (options->quiet_mode == -1) |
|
options->quiet_mode = 0; |
|
if (options->check_mail == -1) |
if (options->check_mail == -1) |
options->check_mail = 0; |
options->check_mail = 0; |
if (options->fascist_logging == -1) |
|
options->fascist_logging = 1; |
|
if (options->print_motd == -1) |
if (options->print_motd == -1) |
options->print_motd = 1; |
options->print_motd = 1; |
if (options->x11_forwarding == -1) |
if (options->x11_forwarding == -1) |
|
|
options->keepalives = 1; |
options->keepalives = 1; |
if (options->log_facility == (SyslogFacility)(-1)) |
if (options->log_facility == (SyslogFacility)(-1)) |
options->log_facility = SYSLOG_FACILITY_AUTH; |
options->log_facility = SYSLOG_FACILITY_AUTH; |
|
if (options->log_level == (LogLevel)(-1)) |
|
options->log_level = SYSLOG_LEVEL_INFO; |
if (options->rhosts_authentication == -1) |
if (options->rhosts_authentication == -1) |
options->rhosts_authentication = 0; |
options->rhosts_authentication = 0; |
if (options->rhosts_rsa_authentication == -1) |
if (options->rhosts_rsa_authentication == -1) |
|
|
typedef enum |
typedef enum |
{ |
{ |
sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, |
sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, |
sPermitRootLogin, sQuietMode, sFascistLogging, sLogFacility, |
sPermitRootLogin, sLogFacility, sLogLevel, |
sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication, |
sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication, |
#ifdef KRB4 |
#ifdef KRB4 |
sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup, |
sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup, |
|
|
{ "logingracetime", sLoginGraceTime }, |
{ "logingracetime", sLoginGraceTime }, |
{ "keyregenerationinterval", sKeyRegenerationTime }, |
{ "keyregenerationinterval", sKeyRegenerationTime }, |
{ "permitrootlogin", sPermitRootLogin }, |
{ "permitrootlogin", sPermitRootLogin }, |
{ "quietmode", sQuietMode }, |
|
{ "fascistlogging", sFascistLogging }, |
|
{ "syslogfacility", sLogFacility }, |
{ "syslogfacility", sLogFacility }, |
|
{ "loglevel", sLogLevel }, |
{ "rhostsauthentication", sRhostsAuthentication }, |
{ "rhostsauthentication", sRhostsAuthentication }, |
{ "rhostsrsaauthentication", sRhostsRSAAuthentication }, |
{ "rhostsrsaauthentication", sRhostsRSAAuthentication }, |
{ "rsaauthentication", sRSAAuthentication }, |
{ "rsaauthentication", sRSAAuthentication }, |
|
|
{ NULL, 0 } |
{ NULL, 0 } |
}; |
}; |
|
|
|
static struct |
|
{ |
|
const char *name; |
|
LogLevel level; |
|
} log_levels[] = |
|
{ |
|
{ "QUIET", SYSLOG_LEVEL_QUIET }, |
|
{ "FATAL", SYSLOG_LEVEL_FATAL }, |
|
{ "ERROR", SYSLOG_LEVEL_ERROR }, |
|
{ "INFO", SYSLOG_LEVEL_INFO }, |
|
{ "CHAT", SYSLOG_LEVEL_CHAT }, |
|
{ "DEBUG", SYSLOG_LEVEL_DEBUG }, |
|
{ NULL, 0 } |
|
}; |
|
|
/* Returns the number of the token pointed to by cp of length len. |
/* Returns the number of the token pointed to by cp of length len. |
Never returns if the token is not known. */ |
Never returns if the token is not known. */ |
|
|
|
|
*intptr = value; |
*intptr = value; |
break; |
break; |
|
|
case sQuietMode: |
|
intptr = &options->quiet_mode; |
|
goto parse_flag; |
|
|
|
case sFascistLogging: |
|
intptr = &options->fascist_logging; |
|
goto parse_flag; |
|
|
|
case sRhostsAuthentication: |
case sRhostsAuthentication: |
intptr = &options->rhosts_authentication; |
intptr = &options->rhosts_authentication; |
goto parse_flag; |
goto parse_flag; |
|
|
exit(1); |
exit(1); |
} |
} |
for (i = 0; log_facilities[i].name; i++) |
for (i = 0; log_facilities[i].name; i++) |
if (strcmp(log_facilities[i].name, cp) == 0) |
if (strcasecmp(log_facilities[i].name, cp) == 0) |
break; |
break; |
if (!log_facilities[i].name) |
if (!log_facilities[i].name) |
{ |
{ |
|
|
} |
} |
if (options->log_facility == (SyslogFacility)(-1)) |
if (options->log_facility == (SyslogFacility)(-1)) |
options->log_facility = log_facilities[i].facility; |
options->log_facility = log_facilities[i].facility; |
|
break; |
|
|
|
case sLogLevel: |
|
cp = strtok(NULL, WHITESPACE); |
|
if (!cp) |
|
{ |
|
fprintf(stderr, "%s line %d: missing level name.\n", |
|
filename, linenum); |
|
exit(1); |
|
} |
|
for (i = 0; log_levels[i].name; i++) |
|
if (strcasecmp(log_levels[i].name, cp) == 0) |
|
break; |
|
if (!log_levels[i].name) |
|
{ |
|
fprintf(stderr, "%s line %d: unsupported log level %s\n", |
|
filename, linenum, cp); |
|
exit(1); |
|
} |
|
if (options->log_level == (LogLevel)(-1)) |
|
options->log_level = log_levels[i].level; |
break; |
break; |
|
|
case sAllowUsers: |
case sAllowUsers: |