]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Globbing across directories is not supported. Fixes #1149.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Jul 2015 01:07:14 +0000 (21:07 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Jul 2015 01:07:14 +0000 (21:07 -0400)
The rest of the "filename_work" code assumes that the detail.work
file is in the same directory as the files being globbed.  In order
to support globbing for directories, the code will have to be updated
to *not* open detail.work, but instead to do a *second* file
globbing() on .../*/detail.work, in order to get the real filename
of the detail.work file.

In the short term it's easier to just enforce the assumptions
in the rest of the code.

src/main/detail.c

index 57c5f0019ab110ca68169ee9c9eda51a22aa0bdf..64625331c8d2d0f6cb6b236418c559d0093b32dd 100644 (file)
@@ -1151,6 +1151,16 @@ int detail_parse(CONF_SECTION *cs, rad_listen_t *this)
                } else {
                        buffer[0] = '\0';
                }
+
+               /*
+                *      Globbing cannot be done across directories.
+                */
+               if ((strchr(buffer, '*') != NULL) ||
+                   (strchr(buffer, '[') != NULL)) {
+                       cf_log_err_cs(cs, "Wildcard directories are not supported");
+                       return -1;
+               }
+
                strlcat(buffer, "detail.work",
                        sizeof(buffer) - strlen(buffer));