Usually %{Realm} (the default). Can also be %{User-Name}, or other
attribute that exists in the request. Note that the module always
keys off of attributes in the request, and NOT in any other packet.
+.IP relaxed
+If set to 'yes', then attributes which do not match any filter rules
+explicitly, will also be allowed. The default is 'no'.
.PP
.SH SECTIONS
.IP preacct
* be used as the instance handle.
*/
struct attr_filter_instance {
- char *attrsfile;
+ char *attrsfile;
char *key;
- PAIR_LIST *attrs;
+ int relaxed;
+ PAIR_LIST *attrs;
};
static const CONF_PARSER module_config[] = {
offsetof(struct attr_filter_instance,attrsfile), NULL, "${raddbdir}/attrs" },
{ "key", PW_TYPE_STRING_PTR,
offsetof(struct attr_filter_instance,key), NULL, "%{Realm}" },
+ { "relaxed", PW_TYPE_BOOLEAN,
+ offsetof(struct attr_filter_instance,relaxed), NULL, "no" },
{ NULL, -1, 0, NULL, NULL }
};
}
}
- /* only move attribute if it passed all rules */
- if (fail == 0 && pass > 0) {
+ /*
+ * Only move attribute if it passed all rules,
+ * or if the config says we should copy unmatched
+ * attributes ('relaxed' mode).
+ */
+ if (fail == 0 && (pass > 0 || inst->relaxed)) {
*output_tail = paircopyvp(vp);
if (!*output_tail) {
pairfree(&output);