mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-04 07:48:36 +00:00
shared: fix search_and_fopen with alternate roots
Update for the current behavior of path_strv_resolve which now returns paths relative to the given root, not the full absolute paths. (cherry picked from commit375eadd911) (cherry picked from commit686e842aec)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
a2d2b499ee
commit
ff96d0f2ca
+4
-1
@@ -5701,7 +5701,10 @@ static int search_and_fopen_internal(const char *path, const char *mode, const c
|
||||
_cleanup_free_ char *p = NULL;
|
||||
FILE *f;
|
||||
|
||||
p = strjoin(*i, "/", path, NULL);
|
||||
if (root)
|
||||
p = strjoin(root, *i, "/", path, NULL);
|
||||
else
|
||||
p = strjoin(*i, "/", path, NULL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user