Merge pull request #600 from swick/wip/get-newroot-path
utils: Move get_newroot_path to utils
This commit is contained in:
@@ -946,14 +946,6 @@ drop_privs (bool keep_requested_caps,
|
|||||||
die_with_error ("can't set dumpable");
|
die_with_error ("can't set dumpable");
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
|
||||||
get_newroot_path (const char *path)
|
|
||||||
{
|
|
||||||
while (*path == '/')
|
|
||||||
path++;
|
|
||||||
return strconcat ("/newroot/", path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_uid_gid_map (uid_t sandbox_uid,
|
write_uid_gid_map (uid_t sandbox_uid,
|
||||||
uid_t parent_uid,
|
uid_t parent_uid,
|
||||||
|
8
utils.c
8
utils.c
@@ -823,6 +823,14 @@ get_oldroot_path (const char *path)
|
|||||||
return strconcat ("/oldroot/", path);
|
return strconcat ("/oldroot/", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
get_newroot_path (const char *path)
|
||||||
|
{
|
||||||
|
while (*path == '/')
|
||||||
|
path++;
|
||||||
|
return strconcat ("/newroot/", path);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
raw_clone (unsigned long flags,
|
raw_clone (unsigned long flags,
|
||||||
void *child_stack)
|
void *child_stack)
|
||||||
|
1
utils.h
1
utils.h
@@ -121,6 +121,7 @@ void create_pid_socketpair (int sockets[2]);
|
|||||||
void send_pid_on_socket (int socket);
|
void send_pid_on_socket (int socket);
|
||||||
int read_pid_from_socket (int socket);
|
int read_pid_from_socket (int socket);
|
||||||
char *get_oldroot_path (const char *path);
|
char *get_oldroot_path (const char *path);
|
||||||
|
char *get_newroot_path (const char *path);
|
||||||
char *readlink_malloc (const char *pathname);
|
char *readlink_malloc (const char *pathname);
|
||||||
|
|
||||||
/* syscall wrappers */
|
/* syscall wrappers */
|
||||||
|
Reference in New Issue
Block a user