399a2a8
From 71265e69fa8a26d8a9669824eeb3ea9d2fe7c923 Mon Sep 17 00:00:00 2001
399a2a8
From: Martin Pitt <martin.pitt@ubuntu.com>
399a2a8
Date: Thu, 5 Mar 2015 14:58:56 +0100
399a2a8
Subject: [PATCH] tmpfiles: Fix handling of duplicate lines
399a2a8
399a2a8
Commit 3f93da987 accidentally dropped the "return 0" after detection of a
399a2a8
duplicate line. Put it back, to get back the documented and intended "first
399a2a8
match wins" behaviour.
399a2a8
399a2a8
https://launchpad.net/bugs/1428540
399a2a8
(cherry picked from commit 6487ada88d63e4998113f4c57fa10b7c865f8026)
399a2a8
---
399a2a8
 src/tmpfiles/tmpfiles.c | 4 +++-
399a2a8
 1 file changed, 3 insertions(+), 1 deletion(-)
399a2a8
399a2a8
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
399a2a8
index 187997e1f4..1e10968164 100644
399a2a8
--- a/src/tmpfiles/tmpfiles.c
399a2a8
+++ b/src/tmpfiles/tmpfiles.c
399a2a8
@@ -1750,9 +1750,11 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
399a2a8
                 unsigned n;
399a2a8
 
399a2a8
                 for (n = 0; n < existing->count; n++) {
399a2a8
-                        if (!item_compatible(existing->items + n, &i))
399a2a8
+                        if (!item_compatible(existing->items + n, &i)) {
399a2a8
                                 log_warning("[%s:%u] Duplicate line for path \"%s\", ignoring.",
399a2a8
                                             fname, line, i.path);
399a2a8
+                                return 0;
399a2a8
+                        }
399a2a8
                 }
399a2a8
         } else {
399a2a8
                 existing = new0(ItemArray, 1);