mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:25:07 -05:00
conf: allow wildcard patterns in include directive
Use glob() to match and read multiple configuration files with one include directive.
This commit is contained in:
14
conf.c
14
conf.c
@@ -1236,8 +1236,20 @@ parse_tempcomp(char *line)
|
||||
static void
|
||||
parse_include(char *line)
|
||||
{
|
||||
glob_t gl;
|
||||
size_t i;
|
||||
|
||||
check_number_of_args(line, 1);
|
||||
CNF_ReadFile(line);
|
||||
|
||||
if (glob(line, 0, NULL, &gl)) {
|
||||
DEBUG_LOG(LOGF_Configure, "glob of %s failed", line);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < gl.gl_pathc; i++)
|
||||
CNF_ReadFile(gl.gl_pathv[i]);
|
||||
|
||||
globfree(&gl);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user