*
* Copyright (C) 1995,1996,1997 Lars Fenneberg
*
* Copyright 1992 Livingston Enterprises, Inc.
*
*
* Copyright (C) 1995,1996,1997 Lars Fenneberg
*
* Copyright 1992 Livingston Enterprises, Inc.
*
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
- * See the file COPYRIGHT for the respective terms and conditions.
- * If the file is missing contact me at lf@elemental.net
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
for (i = 0; i < num_options; i++) {
if (!strcmp(config_options[i].name, optname) &&
(config_options[i].type & type))
for (i = 0; i < num_options; i++) {
if (!strcmp(config_options[i].name, optname) &&
(config_options[i].type & type))
*/
static int set_option_str(char *filename, int line, OPTION *option, char *p)
*/
static int set_option_str(char *filename, int line, OPTION *option, char *p)
*iptr = AUTH_RADIUS_FST;
else {
rc_log(LOG_ERR,"%s: auth_order: unknown keyword: %s", filename, p);
*iptr = AUTH_RADIUS_FST;
else {
rc_log(LOG_ERR,"%s: auth_order: unknown keyword: %s", filename, p);
if (p && (*p != '\0')) {
if ((*iptr & AUTH_RADIUS_FST) && !strcmp(p, "local"))
*iptr = (*iptr) | AUTH_LOCAL_SND;
else if ((*iptr & AUTH_LOCAL_FST) && !strcmp(p, "radius"))
if (p && (*p != '\0')) {
if ((*iptr & AUTH_RADIUS_FST) && !strcmp(p, "local"))
*iptr = (*iptr) | AUTH_LOCAL_SND;
else if ((*iptr & AUTH_LOCAL_FST) && !strcmp(p, "radius"))
else {
rc_log(LOG_ERR,"%s: auth_order: unknown or unexpected keyword: %s", filename, p);
else {
rc_log(LOG_ERR,"%s: auth_order: unknown or unexpected keyword: %s", filename, p);
if ((pos = strcspn(p, "\t ")) == 0) {
rc_log(LOG_ERR, "%s: line %d: bogus format: %s", filename, line, p);
return (-1);
if ((pos = strcspn(p, "\t ")) == 0) {
rc_log(LOG_ERR, "%s: line %d: bogus format: %s", filename, line, p);
return (-1);
if ((option = find_option(p, OT_ANY)) == NULL) {
rc_log(LOG_ERR, "%s: line %d: unrecognized keyword: %s", filename, line, p);
return (-1);
if ((option = find_option(p, OT_ANY)) == NULL) {
rc_log(LOG_ERR, "%s: line %d: unrecognized keyword: %s", filename, line, p);
return (-1);
p++;
switch (option->type) {
case OT_STR:
if (set_option_str(filename, line, option, p) < 0)
p++;
switch (option->type) {
case OT_STR:
if (set_option_str(filename, line, option, p) < 0)
case OT_INT:
if (set_option_int(filename, line, option, p) < 0)
case OT_INT:
if (set_option_int(filename, line, option, p) < 0)
break;
case OT_SRV:
if (set_option_srv(filename, line, option, p) < 0)
break;
case OT_SRV:
if (set_option_srv(filename, line, option, p) < 0)
break;
case OT_AUO:
if (set_option_auo(filename, line, option, p) < 0)
break;
case OT_AUO:
if (set_option_auo(filename, line, option, p) < 0)
* Function: rc_conf_str, rc_conf_int, rc_conf_src
*
* Purpose: get the value of a config option
* Function: rc_conf_str, rc_conf_int, rc_conf_src
*
* Purpose: get the value of a config option
if (!rc_conf_str("dictionary"))
{
rc_log(LOG_ERR,"%s: no dictionary specified", filename);
if (!rc_conf_str("dictionary"))
{
rc_log(LOG_ERR,"%s: no dictionary specified", filename);
if (rc_conf_int("login_tries") <= 0)
{
rc_log(LOG_ERR,"%s: login_tries <= 0 is illegal", filename);
return (-1);
if (rc_conf_int("login_tries") <= 0)
{
rc_log(LOG_ERR,"%s: login_tries <= 0 is illegal", filename);
return (-1);
if (rc_conf_str("seqfile") == NULL)
{
rc_log(LOG_ERR,"%s: seqfile not specified", filename);
return (-1);
if (rc_conf_str("seqfile") == NULL)
{
rc_log(LOG_ERR,"%s: seqfile not specified", filename);
return (-1);
if (rc_conf_int("login_timeout") <= 0)
{
rc_log(LOG_ERR,"%s: login_timeout <= 0 is illegal", filename);
return (-1);
if (rc_conf_int("login_timeout") <= 0)
{
rc_log(LOG_ERR,"%s: login_timeout <= 0 is illegal", filename);
return (-1);
if (rc_conf_str("mapfile") == NULL)
{
rc_log(LOG_ERR,"%s: mapfile not specified", filename);
return (-1);
if (rc_conf_str("mapfile") == NULL)
{
rc_log(LOG_ERR,"%s: mapfile not specified", filename);
return (-1);
if (rc_conf_str("nologin") == NULL)
{
rc_log(LOG_ERR,"%s: nologin not specified", filename);
return (-1);
if (rc_conf_str("nologin") == NULL)
{
rc_log(LOG_ERR,"%s: nologin not specified", filename);
return (-1);
rc_log(LOG_ERR, "rc_find_server: couldn't open file: %s: %s", strerror(errno), rc_conf_str("servers"));
return (-1);
}
rc_log(LOG_ERR, "rc_find_server: couldn't open file: %s: %s", strerror(errno), rc_conf_str("servers"));
return (-1);
}