tree-wide: Get rid of prefix_roota() in favor of path_join()

We deprecated prefix_roota() in favor of chase() and path_join().
Let's finish the removal by replacing the few remaining call sites
with path_join().
This commit is contained in:
Daan De Meyer
2025-05-06 17:40:33 +02:00
parent 38c9ca5380
commit 1fbfbe81b5
14 changed files with 136 additions and 93 deletions
+15 -5
View File
@@ -944,11 +944,21 @@ static int write_files(Context *c) {
_cleanup_(unlink_and_freep) char *passwd_tmp = NULL, *group_tmp = NULL, *shadow_tmp = NULL, *gshadow_tmp = NULL;
int r;
const char
*passwd_path = prefix_roota(arg_root, "/etc/passwd"),
*shadow_path = prefix_roota(arg_root, "/etc/shadow"),
*group_path = prefix_roota(arg_root, "/etc/group"),
*gshadow_path = prefix_roota(arg_root, "/etc/gshadow");
_cleanup_free_ char *passwd_path = path_join(arg_root, "/etc/passwd");
if (!passwd_path)
return log_oom();
_cleanup_free_ char *shadow_path = path_join(arg_root, "/etc/shadow");
if (!shadow_path)
return log_oom();
_cleanup_free_ char *group_path = path_join(arg_root, "/etc/group");
if (!group_path)
return log_oom();
_cleanup_free_ char *gshadow_path = path_join(arg_root, "/etc/gshadow");
if (!gshadow_path)
return log_oom();
assert(c);