* Fix a FIXME. If a varialble in the config file was missing
authorhartwick <hartwick>
Fri, 2 Feb 2001 02:01:37 +0000 (02:01 +0000)
committerhartwick <hartwick>
Fri, 2 Feb 2001 02:01:37 +0000 (02:01 +0000)
  a closing '}' it was skipping over it.  The code now logs
  and error and exits.

src/main/conffile.c

index 1a88e23..09ebe95 100644 (file)
@@ -253,15 +253,16 @@ static const char *cf_expand_variables(const char *cf, int *lineno,
                }
                
                /*
-                *      Look for trailing '}', and silently
-                *      ignore anything that doesn't match.
-                *
-                *      FIXME!  This is probably wrong...
+                *      Look for trailing '}', and log a
+                *      warning for anything that doesn't match,
+                *      and exit with a fatal error.
                 */
                end = strchr(ptr, '}');
                if (end == NULL) {
                        *(p++) = *(ptr++);
-                       continue;
+                       radlog(L_INFO, "%s[%d]: Variable expansion missing }",
+                                       cf, *lineno);
+                       return NULL;
                }
                
                ptr += 2;