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. 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.
+1.15, files with names ending in ".conf" are also included, unless the
+name begins with ".". 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
}
/* Return non-zero if filename contains only alphanumeric characters, dashes,
- * and underscores, or if the filename ends in ".conf". */
+ * and underscores, or if the filename ends in ".conf" and is not a dotfile. */
static int valid_name(const char *filename)
{
const char *p;
size_t len = strlen(filename);
+ /* Ignore dotfiles, which might be editor or filesystem artifacts. */
+ if (*filename == '.')
+ return 0;
+
if (len >= 5 && !strcmp(filename + len - 5, ".conf"))
return 1;