Skip to content

Commit

Permalink
Move attrs filters into their own directory, rename attrsfile to file
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Dec 7, 2012
1 parent 69810aa commit f9f47f5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions raddb/mods-available/attr_filter
Expand Up @@ -10,13 +10,13 @@
# proxied servers, to make sure we send back to our RADIUS client
# only allowed attributes.
attr_filter attr_filter.post-proxy {
attrsfile = ${confdir}/attrs
file = ${confdir}/filter/post-proxy
}

# attr_filter - filters the attributes in the packets we send to
# the RADIUS home servers.
attr_filter attr_filter.pre-proxy {
attrsfile = ${confdir}/attrs.pre-proxy
file = ${confdir}/filter/pre-proxy
}

# Enforce RFC requirements on the contents of Access-Reject
Expand All @@ -25,7 +25,7 @@ attr_filter attr_filter.pre-proxy {
#
attr_filter attr_filter.access_reject {
key = %{User-Name}
attrsfile = ${confdir}/attrs.access_reject
file = ${confdir}/filter/access_reject
}

# Enforce RFC requirements on the contents of Access-Challenge
Expand All @@ -34,7 +34,7 @@ attr_filter attr_filter.access_reject {
#
attr_filter attr_filter.access_challenge {
key = %{User-Name}
attrsfile = ${confdir}/attrs.access_challenge
file = ${confdir}/filter/access_challenge
}


Expand All @@ -44,5 +44,5 @@ attr_filter attr_filter.access_challenge {
#
attr_filter attr_filter.accounting_response {
key = %{User-Name}
attrsfile = ${confdir}/attrs.accounting_response
file = ${confdir}/filter/accounting_response
}
12 changes: 6 additions & 6 deletions src/modules/rlm_attr_filter/rlm_attr_filter.c
Expand Up @@ -41,15 +41,15 @@ RCSID("$Id$")
* be used as the instance handle.
*/
struct attr_filter_instance {
char *attrsfile;
char *file;
char *key;
int relaxed;
PAIR_LIST *attrs;
};

static const CONF_PARSER module_config[] = {
{ "attrsfile", PW_TYPE_FILENAME,
offsetof(struct attr_filter_instance,attrsfile), NULL, "${raddbdir}/attrs" },
{ "file", PW_TYPE_FILENAME,
offsetof(struct attr_filter_instance,file), NULL, "${raddbdir}/attrs" },
{ "key", PW_TYPE_STRING_PTR,
offsetof(struct attr_filter_instance,key), NULL, "%{Realm}" },
{ "relaxed", PW_TYPE_BOOLEAN,
Expand All @@ -75,7 +75,7 @@ static void check_pair(VALUE_PAIR *check_item, VALUE_PAIR *reply_item,
}


static int getattrsfile(const char *filename, PAIR_LIST **pair_list)
static int attr_filter_getfile(const char *filename, PAIR_LIST **pair_list)
{
int rcode;
PAIR_LIST *attrs = NULL;
Expand Down Expand Up @@ -154,9 +154,9 @@ static int attr_filter_instantiate(CONF_SECTION *conf, void **instance)
return -1;
}

rcode = getattrsfile(inst->attrsfile, &inst->attrs);
rcode = attr_filter_getfile(inst->file, &inst->attrs);
if (rcode != 0) {
radlog(L_ERR|L_CONS, "Errors reading %s", inst->attrsfile);
radlog(L_ERR|L_CONS, "Errors reading %s", inst->file);
attr_filter_detach(inst);
return -1;
}
Expand Down

0 comments on commit f9f47f5

Please sign in to comment.