|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From 695c8554ca6a64f749de265ba29566d3c95fe77c Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From: Michael Marineau <michael.marineau@coreos.com>
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Date: Thu, 19 Jun 2014 19:07:06 -0700
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Subject: [PATCH] shared: fix search_and_fopen with alternate roots
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Update for the current behavior of path_strv_resolve which now returns
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
paths relative to the given root, not the full absolute paths.
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
(cherry picked from commit 375eadd911a9f83f89f1e7de5e05f44cc81e3642)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
src/shared/util.c | 5 ++++-
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
diff --git a/src/shared/util.c b/src/shared/util.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
index 02cfd499..6165d72d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
--- a/src/shared/util.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+++ b/src/shared/util.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
@@ -5682,7 +5682,10 @@ static int search_and_fopen_internal(const char *path, const char *mode, const c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
_cleanup_free_ char *p = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
FILE *f;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
- p = strjoin(*i, "/", path, NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ if (root)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ p = strjoin(root, *i, "/", path, NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ else
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ p = strjoin(*i, "/", path, NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
if (!p)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
return -ENOMEM;
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|