utils: Move get_newroot_path to utils

We already have `get_oldroot_path` in utils, so let's be consistent
about this.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
Sebastian Wick 2023-09-28 18:25:37 +02:00
parent ad76c2d6ba
commit b367272d59
3 changed files with 9 additions and 8 deletions

View File

@ -944,14 +944,6 @@ drop_privs (bool keep_requested_caps,
die_with_error ("can't set dumpable");
}
static char *
get_newroot_path (const char *path)
{
while (*path == '/')
path++;
return strconcat ("/newroot/", path);
}
static void
write_uid_gid_map (uid_t sandbox_uid,
uid_t parent_uid,

View File

@ -823,6 +823,14 @@ get_oldroot_path (const char *path)
return strconcat ("/oldroot/", path);
}
char *
get_newroot_path (const char *path)
{
while (*path == '/')
path++;
return strconcat ("/newroot/", path);
}
int
raw_clone (unsigned long flags,
void *child_stack)

View File

@ -121,6 +121,7 @@ void create_pid_socketpair (int sockets[2]);
void send_pid_on_socket (int socket);
int read_pid_from_socket (int socket);
char *get_oldroot_path (const char *path);
char *get_newroot_path (const char *path);
char *readlink_malloc (const char *pathname);
/* syscall wrappers */