Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keydb.conf: support globbing in include directive #884

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blakejalexander
Copy link

The existing example keydb.conf indicates that wildcard pattern matching is supported for the include directive, i.e. it implies that:

  • include /etc/keydb.conf
  • include /etc/keydb.d/server-specific.conf
  • include /etc/keydb.d/*.conf

should all be supported. However, glob-style matching support is not enabled by the configuration parser. This commit treats the arguments to the include directive as glob patterns via the POSIX standard glob.h library, and calls the loadServerConfig function as many times as necessary - either once (for no pattern), or as many times as there are files matching the pattern.

This is the preferred solution used in other open source projects, see (for example) the implementation in openssh.

This was mentioned in #875 and directly resolves that issue. See also #401 for an earlier discussion.

The existing example keydb.conf indicates that wildcard pattern matching
is supported for the include directive, i.e. it implies that:

- include /etc/keydb.conf
- include /etc/keydb.d/server-specific.conf
- include /etc/keydb.d/*.conf

should all be supported. However, glob-style matching support is not
enabled by the configuration parser. This commit treats the arguments to
the include directive as glob patterns via the POSIX standard glob.h
library, and calls the loadServerConfig function as many times as
necessary.

Signed-off-by: Blake Alexander <[email protected]>
@blakejalexander blakejalexander force-pushed the include-directive-glob-matching branch from 989e913 to bb13a48 Compare December 11, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant