valeriyvdovin / rpms / systemd

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