diff --git a/freeradius-exclude-config-file.patch b/freeradius-exclude-config-file.patch index fecff20..2710349 100644 --- a/freeradius-exclude-config-file.patch +++ b/freeradius-exclude-config-file.patch @@ -1,10 +1,10 @@ -diff -b -u -r freeradius-server-2.2.0.orig/src/include/libradius.h freeradius-server-2.2.0.configfile/src/include/libradius.h +diff -u -r freeradius-server-2.2.0.orig/src/include/libradius.h freeradius-server-2.2.0.configfile/src/include/libradius.h --- freeradius-server-2.2.0.orig/src/include/libradius.h 2012-09-10 07:51:34.000000000 -0400 -+++ freeradius-server-2.2.0.configfile/src/include/libradius.h 2012-10-03 09:36:55.764852014 -0400 -@@ -415,6 +415,17 @@ - struct sockaddr_storage *sa, socklen_t *salen); ++++ freeradius-server-2.2.0.configfile/src/include/libradius.h 2012-10-03 15:45:13.002106110 -0400 +@@ -416,6 +416,17 @@ int fr_sockaddr2ipaddr(const struct sockaddr_storage *sa, socklen_t salen, fr_ipaddr_t *ipaddr, int * port); + +int +str_starts_with(const char *subject, const char *pattern); +int @@ -16,25 +16,26 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/include/libradius.h freeradius-se +int +fr_exclude_config_file(const char *basename); + - - + #ifdef ASCEND_BINARY -diff -b -u -r freeradius-server-2.2.0.orig/src/lib/misc.c freeradius-server-2.2.0.configfile/src/lib/misc.c + /* filters.c */ +diff -u -r freeradius-server-2.2.0.orig/src/lib/misc.c freeradius-server-2.2.0.configfile/src/lib/misc.c --- freeradius-server-2.2.0.orig/src/lib/misc.c 2012-09-10 07:51:34.000000000 -0400 -+++ freeradius-server-2.2.0.configfile/src/lib/misc.c 2012-10-03 10:29:43.332507533 -0400 ++++ freeradius-server-2.2.0.configfile/src/lib/misc.c 2012-10-03 15:50:27.717357782 -0400 @@ -28,6 +28,7 @@ #include #include #include +#include - + int fr_dns_lookups = 0; int fr_debug_flag = 0; -@@ -650,3 +651,161 @@ - +@@ -650,3 +651,162 @@ + return 1; } + ++ +/* + * Return true if subject starts with pattern, false otherwise. + * subject and pattern are NULL terminated strings. @@ -192,12 +193,12 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/lib/misc.c freeradius-server-2.2. +} + +#endif -diff -b -u -r freeradius-server-2.2.0.orig/src/main/client.c freeradius-server-2.2.0.configfile/src/main/client.c +diff -u -r freeradius-server-2.2.0.orig/src/main/client.c freeradius-server-2.2.0.configfile/src/main/client.c --- freeradius-server-2.2.0.orig/src/main/client.c 2012-09-10 07:51:34.000000000 -0400 -+++ freeradius-server-2.2.0.configfile/src/main/client.c 2012-10-03 10:53:33.166452136 -0400 ++++ freeradius-server-2.2.0.configfile/src/main/client.c 2012-10-03 15:52:35.351241760 -0400 @@ -845,13 +845,24 @@ } - + /* - * Read the directory, ignoring "." files. + * Read the directory, ignoring invalid files. @@ -205,7 +206,7 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/main/client.c freeradius-server-2 while ((dp = readdir(dir)) != NULL) { const char *p; RADCLIENT *dc; - + - if (dp->d_name[0] == '.') continue; + /* + * Check for invalid file names @@ -219,7 +220,7 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/main/client.c freeradius-server-2 + } + continue; + } - + /* * Check for valid characters @@ -863,7 +874,12 @@ @@ -233,22 +234,22 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/main/client.c freeradius-server-2 + value, dp->d_name); + continue; + } - + snprintf(buf2, sizeof(buf2), "%s/%s", value, dp->d_name); -diff -b -u -r freeradius-server-2.2.0.orig/src/main/conffile.c freeradius-server-2.2.0.configfile/src/main/conffile.c +diff -u -r freeradius-server-2.2.0.orig/src/main/conffile.c freeradius-server-2.2.0.configfile/src/main/conffile.c --- freeradius-server-2.2.0.orig/src/main/conffile.c 2012-09-10 07:51:34.000000000 -0400 -+++ freeradius-server-2.2.0.configfile/src/main/conffile.c 2012-10-03 10:55:05.918611881 -0400 ++++ freeradius-server-2.2.0.configfile/src/main/conffile.c 2012-10-03 15:54:17.465348844 -0400 @@ -1512,12 +1512,23 @@ } - + /* - * Read the directory, ignoring "." files. + * Read the directory, ignoring invalid files. */ while ((dp = readdir(dir)) != NULL) { const char *p; - + - if (dp->d_name[0] == '.') continue; + /* + * Check for invalid file names @@ -262,7 +263,7 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/main/conffile.c freeradius-server + continue; + } + - + /* * Check for valid characters @@ -1530,7 +1541,11 @@ @@ -275,22 +276,22 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/main/conffile.c freeradius-server + value, dp->d_name); + continue; + } - + snprintf(buf2, sizeof(buf2), "%s%s", value, dp->d_name); -diff -b -u -r freeradius-server-2.2.0.orig/src/modules/rlm_policy/parse.c freeradius-server-2.2.0.configfile/src/modules/rlm_policy/parse.c +diff -u -r freeradius-server-2.2.0.orig/src/modules/rlm_policy/parse.c freeradius-server-2.2.0.configfile/src/modules/rlm_policy/parse.c --- freeradius-server-2.2.0.orig/src/modules/rlm_policy/parse.c 2012-09-10 07:51:34.000000000 -0400 -+++ freeradius-server-2.2.0.configfile/src/modules/rlm_policy/parse.c 2012-10-03 10:57:16.985425570 -0400 ++++ freeradius-server-2.2.0.configfile/src/modules/rlm_policy/parse.c 2012-10-03 15:55:29.736715648 -0400 @@ -1584,13 +1584,22 @@ } - + /* - * Read the directory, ignoring "." files. + * Read the directory, ignoring invalid files. */ while ((dp = readdir(dir)) != NULL) { struct stat buf; - + - if (dp->d_name[0] == '.') continue; - if (strchr(dp->d_name, '~') != NULL) continue; + /* @@ -304,11 +305,6 @@ diff -b -u -r freeradius-server-2.2.0.orig/src/modules/rlm_policy/parse.c freera + } + continue; + } - + strlcpy(p, dp->d_name, sizeof(buffer) - (p - buffer)); -@@ -1704,4 +1713,3 @@ - - return 1; - } --