]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow error to pass up from dict_unknown_from_substr
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 2 Jan 2015 05:05:22 +0000 (00:05 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 2 Jan 2015 05:11:06 +0000 (00:11 -0500)
src/main/tmpl.c

index 6a0c6f30093fb88c801136b7b0e835de7711be1b..2cd37003c074c8a6909496ee657db8faa80ac6f7 100644 (file)
@@ -831,6 +831,8 @@ ssize_t tmpl_from_attr_substr(value_pair_tmpl_t *vpt, char const *name,
                 */
                a = p;
 
+               fr_strerror();  /* Clear out any existing errors */
+
                /*
                 *      Attr-1.2.3.4 is OK.
                 */
@@ -855,11 +857,11 @@ ssize_t tmpl_from_attr_substr(value_pair_tmpl_t *vpt, char const *name,
                /*
                 *      Can't parse it as an attribute, might be a literal string
                 *      let the caller decide.
+                *
+                *      Don't alter the fr_strerror buffer, should contain the parse
+                *      error from dict_unknown_from_substr.
                 */
-               if (!allow_undefined) {
-                       fr_strerror_printf("Undefined attribute");
-                       return -(a - name);
-               }
+               if (!allow_undefined) return -(a - name);
 
                /*
                 *      Copy the name to a field for later resolution