return len;
}
+/**
+ * @brief xlat expand string attribute value
+ */
+static size_t xlat_xlat(UNUSED void *instance, REQUEST *request,
+ const char *fmt, char *out, size_t outlen)
+{
+ VALUE_PAIR *vp;
+
+ while (isspace((int) *fmt)) fmt++;
+
+ if (outlen < 3) {
+ nothing:
+ *out = '\0';
+ return 0;
+ }
+
+ if (radius_get_vp(request, fmt, &vp) < 0) goto nothing;
+
+ if (!vp) goto nothing;
+
+ return radius_xlat(out, outlen, vp->vp_strvalue, request, NULL, NULL);
+}
+
#ifdef HAVE_REGEX_H
/*
* @brief Expand regexp matches %{0} to %{8}
XLAT_REGISTER(hex);
XLAT_REGISTER(base64);
XLAT_REGISTER(string);
+ XLAT_REGISTER(xlat);
XLAT_REGISTER(module);
#ifdef HAVE_REGEX_H
* RADIUS attribute to LDAP attribute maps
*/
VALUE_PAIR_MAP *user_map; /* Applied to users and profiles */
-
- int do_xlat;
-
+
/*
* Access related configuration
*/
/*
* Terrible things which should be deleted.
*/
- {"do_xlat", PW_TYPE_BOOLEAN,
- offsetof(ldap_instance,do_xlat), NULL, "yes"},
-
{ "profiles", PW_TYPE_SUBSECTION, 0, NULL, (const void *) attr_config },
{ "group", PW_TYPE_SUBSECTION, 0, NULL, (const void *) group_config },