]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix issue where field nas_type would not be accessible via 1318/head
authorJorge Pereira <jpereiran@gmail.com>
Thu, 8 Oct 2015 22:39:48 +0000 (19:39 -0300)
committerJorge Pereira <jpereiran@gmail.com>
Thu, 8 Oct 2015 22:39:48 +0000 (19:39 -0300)
the %{client:} xlat, for clients loaded from SQL.

doc/ChangeLog
src/main/mainconfig.c

index a30963b9b1765ff715a91773372651913ea2311d..6ecbac18d1098eb127d35456be045184efc12339 100644 (file)
@@ -2,6 +2,8 @@ FreeRADIUS 3.0.11 Mon 05 Oct 2015 15:00:00 EDT urgency=medium
        Feature improvements
 
        Bug fixes
+       * Fix issue where field nas_type would not be accessible via
+         the %{client:} xlat, for clients loaded from SQL.
 
 FreeRADIUS 3.0.10 Mon 05 Oct 2015 15:00:00 EDT urgency=medium
        Feature improvements
index 3046906cb836a7003fe713fee9c55d1e678fc917..fca72214466d5fc9c773afdc1589e8288d6e7f77 100644 (file)
@@ -384,12 +384,15 @@ static ssize_t xlat_client(UNUSED void *instance, REQUEST *request, char const *
 
        cp = cf_pair_find(request->client->cs, fmt);
        if (!cp || !(value = cf_pair_value(cp))) {
-               if (strcmp(fmt, "shortname") == 0) {
-                       strlcpy(out, request->client->shortname, outlen);
-                       return strlen(out);
+               if (strcmp(fmt, "shortname") == 0 && request->client->shortname) {
+                       value = request->client->shortname;
+               }
+               else if (strcmp(fmt, "nas_type") == 0 && request->client->nas_type) {
+                       value = request->client->nas_type;
+               } else {
+                       *out = '\0';
+                       return 0;
                }
-               *out = '\0';
-               return 0;
        }
 
        strlcpy(out, value, outlen);