chiark / gitweb /
conf-files: beef up conf-files.[ch] a bit
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Apr 2018 19:24:13 +0000 (21:24 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commitb395aac97d4b8be2f3e6232ba0412ff8203b47bb
treee708ef0492069e0594d4209bdab53c8945e09b3d
parentc3b609e3c6df2b203a980f515017d749eb665124
conf-files: beef up conf-files.[ch] a bit

This adds fozr new flags:

- If CONF_FILES_DIRECTORY is specified conf_file_list() and friends
  will look for directories only.

- Similar CONF_FILES_REGULAR means we'll look only for regular files.

- If CONF_FILES_BASENAME is specified the resulting list will contain
  only the basenames of all discovered files or directories, not the
  full paths.

- If CONF_FILES_FILTER_MASKED is specified the resulting list will have
  masked entries removed (i.e. those symlinked to /dev/null and
  suchlike)

These four flags are useful for discovering portable service profile
information.

While we are at it, also improve a couple of other things:

- More debug logging

- use path_hash_ops instead of string_hash_ops when putting together the
  path lists
src/basic/conf-files.c
src/basic/conf-files.h
src/basic/exec-util.c
src/test/test-conf-files.c