mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +00:00
ns: Always start usernsd
We need a parent for pid_ns helpers. This can't be criu task, as this introduces circular dependencies. So choose usernsd for that, as we create it almost always. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
589c378e12
commit
7ef7bf8f75
@@ -1429,7 +1429,7 @@ struct unsc_msg {
|
|||||||
char c[CMSG_SPACE(sizeof(struct ucred)) + CMSG_SPACE(sizeof(int))];
|
char c[CMSG_SPACE(sizeof(struct ucred)) + CMSG_SPACE(sizeof(int))];
|
||||||
};
|
};
|
||||||
|
|
||||||
static int usernsd_pid;
|
int usernsd_pid;
|
||||||
|
|
||||||
static inline void unsc_msg_init(struct unsc_msg *m, uns_call_t *c,
|
static inline void unsc_msg_init(struct unsc_msg *m, uns_call_t *c,
|
||||||
int *x, void *arg, size_t asize, int fd)
|
int *x, void *arg, size_t asize, int fd)
|
||||||
@@ -1657,7 +1657,7 @@ static int start_usernsd(void)
|
|||||||
int sk[2];
|
int sk[2];
|
||||||
int one = 1;
|
int one = 1;
|
||||||
|
|
||||||
if (!(root_ns_mask & CLONE_NEWUSER))
|
if (!(root_ns_mask & (CLONE_NEWUSER|CLONE_NEWPID)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1336,7 +1336,7 @@ static int userns_restore_one_link(void *arg, int fd, pid_t pid)
|
|||||||
struct newlink_req *req = arg;
|
struct newlink_req *req = arg;
|
||||||
int ns_fd = get_service_fd(NS_FD_OFF), rst = -1;
|
int ns_fd = get_service_fd(NS_FD_OFF), rst = -1;
|
||||||
|
|
||||||
if (!(root_ns_mask & CLONE_NEWUSER)) {
|
if (ns_fd > 0) {
|
||||||
if (switch_ns_by_fd(ns_fd, &net_ns_desc, &rst))
|
if (switch_ns_by_fd(ns_fd, &net_ns_desc, &rst))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user