unit-file: tighten unit file discovery checks
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Sep 2021 13:21:38 +0000 (15:21 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Oct 2021 03:28:19 +0000 (12:28 +0900)
commit95ef0eaf0d5cd43fcc8e9eb541f2c342f25f8f2f
tree25d44dfc133208f4b9cea49b39866946b3d30365
parent1eb3ef78b4df28a9e9f464714208f2682f957e36
unit-file: tighten unit file discovery checks

Only accept DT_REG/DT_LNK/DT_DIR entries, ignore all others.

Only accpet DT_REG/DT_LNK for file names that are valid unit file names.

Only accept DT_DIR for filenames that are valid unit file names which
are suffixed by .d, .wants, .requires

This doesn't really fix any bugs, but tightens what we insert into the
lookup tables.
src/basic/unit-file.c