simplify application of radius config

This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-19 15:39:24 +02:00
parent 0abc1ee2db
commit e9cb3b1d60
4 changed files with 5 additions and 13 deletions
+2 -6
View File
@@ -48,7 +48,6 @@
static rc_handle *rh = NULL;
static char nas_identifier[64];
static unsigned override_config = 0;
static void radius_global_init(void *pool, void *additional)
{
@@ -62,9 +61,6 @@ static void radius_global_init(void *pool, void *additional)
goto fail;
}
if (config->no_override_config == 0)
override_config = 1;
if (config->nas_identifier) {
strlcpy(nas_identifier, config->nas_identifier, sizeof(nas_identifier));
} else {
@@ -339,9 +335,9 @@ static int radius_auth_pass(void *ctx, const char *pass, unsigned pass_len)
} else if (vp->attribute == PW_FRAMED_IPV6_ROUTE && vp->type == PW_TYPE_STRING) {
/* Framed-IPv6-Route */
append_route(pctx, vp->strvalue, vp->lvalue);
} else if (vp->attribute == PW_INTERIM_INTERVAL && vp->type == PW_TYPE_INTEGER && override_config != 0) {
} else if (vp->attribute == PW_INTERIM_INTERVAL && vp->type == PW_TYPE_INTEGER) {
pctx->interim_interval_secs = vp->lvalue;
} else if (vp->attribute == PW_SESSION_TIMEOUT && vp->type == PW_TYPE_INTEGER && override_config != 0) {
} else if (vp->attribute == PW_SESSION_TIMEOUT && vp->type == PW_TYPE_INTEGER) {
pctx->session_timeout_secs = vp->lvalue;
} else {
syslog(LOG_DEBUG, "radius-auth: ignoring server's value %u of type %u", (int)vp->attribute, (int)vp->type);
-1
View File
@@ -37,7 +37,6 @@ typedef struct gssapi_cfg_st {
typedef struct radius_cfg_st {
char *config;
char *nas_identifier;
unsigned no_override_config;
} radius_cfg_st;
typedef struct plain_cfg_st {
+3 -4
View File
@@ -94,12 +94,11 @@ An example configuration file follows.
# One entry must be listed per line, and 'ocpasswd' should be used
# to generate password entries.
#
# radius[config=/etc/radiusclient/radiusclient.conf,groupconfig=true,nas-identifier=name,override-config=false]:
# radius[config=/etc/radiusclient/radiusclient.conf,groupconfig=true,nas-identifier=name]:
# The radius option requires specifying freeradius-client configuration
# file. If the groupconfig option is set, then config-per-user will be overriden,
# and all configuration will be read from radius. The 'override-config' if set to
# false will ignore Acct-Interim-Interval, Session-Timeout from the server and only the
# configured values will be considered.
# and all configuration will be read from radius. That also includes the
# Acct-Interim-Interval, and Session-Timeout values.
#
# The supported atributes for radius configuration are:
# Group-Name, Framed-IPv6-Address, Framed-IPv6-Prefix, DNS-Server-IPv6-Address,
-2
View File
@@ -230,8 +230,6 @@ void *radius_get_brackets_string(struct perm_cfg_st *config, const char *str)
} else if (c_strcasecmp(vals[i].name, "nas-identifier") == 0) {
additional->nas_identifier = vals[i].value;
vals[i].value = NULL;
} else if (c_strcasecmp(vals[i].name, "override-config") == 0) {
additional->no_override_config = 1-CHECK_TRUE(vals[i].value);
} else if (c_strcasecmp(vals[i].name, "groupconfig") == 0) {
if (CHECK_TRUE(vals[i].value))
config->sup_config_type = SUP_CONFIG_RADIUS;