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