ryantimwilson / rpms / systemd

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