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