chiark / gitweb /
tmpfiles: Fix handling of duplicate lines
authorMartin Pitt <martin.pitt@ubuntu.com>
Thu, 5 Mar 2015 13:58:56 +0000 (14:58 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Thu, 5 Mar 2015 15:14:07 +0000 (16:14 +0100)
Commit 3f93da987 accidentally dropped the "return 0" after detection of a
duplicate line. Put it back, to get back the documented and intended "first
match wins" behaviour.

https://launchpad.net/bugs/1428540

src/tmpfiles/tmpfiles.c

index 917bb3c52898f0cdf80fedbeb5e90478550bdce6..652fe5f229ca653993f95cf89aa504dca0b947bf 100644 (file)
@@ -1746,9 +1746,11 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
                 unsigned n;
 
                 for (n = 0; n < existing->count; n++) {
-                        if (!item_compatible(existing->items + n, &i))
+                        if (!item_compatible(existing->items + n, &i)) {
                                 log_warning("[%s:%u] Duplicate line for path \"%s\", ignoring.",
                                             fname, line, i.path);
+                                return 0;
+                        }
                 }
         } else {
                 existing = new0(ItemArray, 1);