]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: add generic `ignore` extension to the hidden/backup files
authorChristoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Tue, 4 Nov 2025 14:45:45 +0000 (15:45 +0100)
committerChristoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Tue, 4 Nov 2025 14:45:45 +0000 (15:45 +0100)
All currently ignored extensions either “belong” to some other program (and may
thus be used, changed or interpreted by that) or imply a certain meaning (like
`bak`, `old` and `new`).

This adds the more generic extension `ignore` which is meant to imply no purpose
whatsoever.

A use case would be the following scenario:

One might want to share a drop-in configuration over multiple units like in:
`/etc/systemd/system/a.service/foo.conf` and
`/etc/systemd/system/b.service/foo.conf`, which then would be symbolic links to
the actual file.

Of course one could place that actual file in a directory that is not parsed by
systemd, but it is unit-configuration after all, so it would be nice to have it
somewhere beneath `/etc/systemd/system` (or other parsed directories).

However, placing it there needs a way to ensure that it’s never accidentally
used by systemd, which this extension is meant for.

src/basic/path-util.c

index 0972dd8de0c9715910bd86e0092eca17f0f0afa9..7d11467a23b2976bdf6cc819739c42ded1c6b660 100644 (file)
@@ -1304,6 +1304,7 @@ bool hidden_or_backup_file(const char *filename) {
          */
 
         return STR_IN_SET(dot + 1,
+                          "ignore",
                           "rpmnew",
                           "rpmsave",
                           "rpmorig",