From f9f47f5dbc1d72d0cf8896d25d0bdfc5862728d7 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Fri, 7 Dec 2012 22:02:08 +0000 Subject: [PATCH] Move attrs filters into their own directory, rename attrsfile to file --- .../access_challenge} | 0 raddb/{attrs.access_reject => filter/access_reject} | 0 .../accounting_response} | 0 raddb/{attrs => filter/post-proxy} | 0 raddb/{attrs.pre-proxy => filter/pre-proxy} | 0 raddb/mods-available/attr_filter | 10 +++++----- src/modules/rlm_attr_filter/rlm_attr_filter.c | 12 ++++++------ 7 files changed, 11 insertions(+), 11 deletions(-) rename raddb/{attrs.access_challenge => filter/access_challenge} (100%) rename raddb/{attrs.access_reject => filter/access_reject} (100%) rename raddb/{attrs.accounting_response => filter/accounting_response} (100%) rename raddb/{attrs => filter/post-proxy} (100%) rename raddb/{attrs.pre-proxy => filter/pre-proxy} (100%) diff --git a/raddb/attrs.access_challenge b/raddb/filter/access_challenge similarity index 100% rename from raddb/attrs.access_challenge rename to raddb/filter/access_challenge diff --git a/raddb/attrs.access_reject b/raddb/filter/access_reject similarity index 100% rename from raddb/attrs.access_reject rename to raddb/filter/access_reject diff --git a/raddb/attrs.accounting_response b/raddb/filter/accounting_response similarity index 100% rename from raddb/attrs.accounting_response rename to raddb/filter/accounting_response diff --git a/raddb/attrs b/raddb/filter/post-proxy similarity index 100% rename from raddb/attrs rename to raddb/filter/post-proxy diff --git a/raddb/attrs.pre-proxy b/raddb/filter/pre-proxy similarity index 100% rename from raddb/attrs.pre-proxy rename to raddb/filter/pre-proxy diff --git a/raddb/mods-available/attr_filter b/raddb/mods-available/attr_filter index b56b34947def..0a0861b16c91 100644 --- a/raddb/mods-available/attr_filter +++ b/raddb/mods-available/attr_filter @@ -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 @@ -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 @@ -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 } @@ -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 } diff --git a/src/modules/rlm_attr_filter/rlm_attr_filter.c b/src/modules/rlm_attr_filter/rlm_attr_filter.c index 46f85efd0596..c6bfda8df263 100644 --- a/src/modules/rlm_attr_filter/rlm_attr_filter.c +++ b/src/modules/rlm_attr_filter/rlm_attr_filter.c @@ -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, @@ -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; @@ -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; }