]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
delta: don't ignore PREFIX when the given argument is PREFIX/SUFFIX 7540/head
authorFranck Bui <fbui@suse.com>
Thu, 7 Dec 2017 20:17:56 +0000 (21:17 +0100)
committerFranck Bui <fbui@suse.com>
Thu, 7 Dec 2017 20:41:35 +0000 (21:41 +0100)
Before this patch, when systemd-delta was asked for overwritten configuration
files in a directory specified by PREFIX/SUFFIX, it ignored the given PREFIX
and listed all overwritten files matching the subdirectory specified by
SUFFIX. Hence we could get the following:

  $ ./build/systemd-delta /usr/local/lib/systemd/system
  [REDIRECTED] /etc/systemd/system/default.target → /usr/lib/systemd/system/default.target
  [EXTENDED]   /usr/lib/systemd/system/systemd-sysctl.service → /usr/lib/systemd/system/systemd-sysctl.service.d/50-kernel-uname_r.conf

systemd-delta showed overwritten configuration files in /usr/lib whereas only
overwritten ones in /usr/local/lib should have been reported (none in my case).

With the patch applied, we now get:

  $ ./build/systemd-delta /usr/local/lib/systemd/system
  0 overridden configuration files found.

src/delta/delta.c

index 6d99d75d3df863fca220a8b21fdb7bb962d971b6..9c8841d46de87e1649ce59a78eafd2f3e650d642 100644 (file)
@@ -528,7 +528,7 @@ static int process_suffix_chop(const char *arg) {
                 if (suffix) {
                         suffix += strspn(suffix, "/");
                         if (*suffix)
-                                return process_suffix(suffix, NULL);
+                                return process_suffix(suffix, p);
                         else
                                 return process_suffixes(arg);
                 }