find-esp: use path_prefix_root_cwd()
Unlikely, but even if find_esp() or friends called with unnormalized or relative 'root', let's make the result path normalized and absolute. Note, before63105f33ed, these functions returned an absolute and normalized path. But the commit made the result path simply concatenated with root. Follow-up for63105f33ed.
This commit is contained in:
+6
-10
@@ -540,11 +540,9 @@ int find_esp_and_warn(
|
||||
return r;
|
||||
|
||||
if (ret_path) {
|
||||
char *q = path_join(empty_to_root(root), p);
|
||||
if (!q)
|
||||
return -ENOMEM;
|
||||
|
||||
*ret_path = TAKE_PTR(q);
|
||||
r = path_prefix_root_cwd(p, root, ret_path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
if (ret_part)
|
||||
*ret_part = part;
|
||||
@@ -861,11 +859,9 @@ int find_xbootldr_and_warn(
|
||||
return r;
|
||||
|
||||
if (ret_path) {
|
||||
char *q = path_join(empty_to_root(root), p);
|
||||
if (!q)
|
||||
return -ENOMEM;
|
||||
|
||||
*ret_path = TAKE_PTR(q);
|
||||
r = path_prefix_root_cwd(p, root, ret_path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
if (ret_uuid)
|
||||
*ret_uuid = uuid;
|
||||
|
||||
Reference in New Issue
Block a user