*FILENAME* or *DIRNAME* should be an absolute path. The named file or
directory must exist and be readable. Including a directory includes
all files within the directory whose names consist solely of
-alphanumeric characters, dashes, or underscores. Included profile
-files are syntactically independent of their parents, so each included
-file must begin with a section header.
+alphanumeric characters, dashes, or underscores. Starting in release
+1.15, files with names ending in ".conf" are also included. Included
+profile files are syntactically independent of their parents, so each
+included file must begin with a section header.
The krb5.conf file can specify that configuration should be obtained
from a loadable module, rather than the file itself, using the
\fIFILENAME\fP or \fIDIRNAME\fP should be an absolute path. The named file or
directory must exist and be readable. Including a directory includes
all files within the directory whose names consist solely of
-alphanumeric characters, dashes, or underscores. Included profile
-files are syntactically independent of their parents, so each included
-file must begin with a section header.
+alphanumeric characters, dashes, or underscores, or any filename
+ending in ".conf". Included profile files are syntactically
+independent of their parents, so each included file must begin with a
+section header.
.sp
The krb5.conf file can specify that configuration should be obtained
from a loadable module, rather than the file itself, using the
}
/* Return non-zero if filename contains only alphanumeric characters, dashes,
- * and underscores. */
+ * and underscores, or if the filename ends in ".conf". */
static int valid_name(const char *filename)
{
const char *p;
+ size_t len = strlen(filename);
+
+ if (len >= 5 && !strcmp(filename + len - 5, ".conf"))
+ return 1;
for (p = filename; *p != '\0'; p++) {
if (!isalnum((unsigned char)*p) && *p != '-' && *p != '_')
}
/*
- * Include files within dirname. Only files with names consisting entirely of
- * alphanumeric chracters, dashes, and underscores are included, in order to
- * avoid including editor backup files, .rpmsave files, and the like.
+ * Include files within dirname. Only files with names ending in ".conf", or
+ * consisting entirely of alphanumeric characters, dashes, and underscores are
+ * included. This restriction avoids including editor backup files, .rpmsave
+ * files, and the like.
*/
static errcode_t parse_include_dir(const char *dirname,
struct profile_node *root_section)
}
profile_release $p
- # Test including a directory. (Put two copies of test2.ini inside
- # it and check that we get two values for one of the variables.)
+ # Test including a directory. Put four copies of test2.ini inside
+ # the directory, two with invalid names. Check that we get two
+ # values for one of the variables.
catch [file delete -force $wd/test_include_dir]
exec mkdir $wd/test_include_dir
exec cp $wd/test2.ini $wd/test_include_dir/a
- exec cp $wd/test2.ini $wd/test_include_dir/b
+ exec cp $wd/test2.ini $wd/test_include_dir/a~
+ exec cp $wd/test2.ini $wd/test_include_dir/b.conf
+ exec cp $wd/test2.ini $wd/test_include_dir/b.conf.rpmsave
catch [file delete $wd/testinc.ini]
exec echo "includedir $wd/test_include_dir" >$wd/testinc.ini
set p [profile_init_path $wd/testinc.ini]