mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
nsfs: add ioctl to get a parent namespace
Pid and user namepaces are hierarchical. There is no way to discover parent-child relationships. In a future we will use this interface to dump and restore nested namespaces. Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
committed by
Eric W. Biederman
parent
6786741dbf
commit
a7306ed8d9
@@ -171,6 +171,10 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl,
|
||||
switch (ioctl) {
|
||||
case NS_GET_USERNS:
|
||||
return open_related_ns(ns, ns_get_owner);
|
||||
case NS_GET_PARENT:
|
||||
if (!ns->ops->get_parent)
|
||||
return -EINVAL;
|
||||
return open_related_ns(ns, ns->ops->get_parent);
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user