KeyDB icon indicating copy to clipboard operation
KeyDB copied to clipboard

keydb.conf: support globbing in include directive

Open blakejalexander opened this issue 1 year ago • 0 comments

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.

blakejalexander avatar Dec 11 '24 12:12 blakejalexander