mirror of
https://github.com/containers/podman.git
synced 2025-05-23 01:57:56 +08:00
Merge pull request #3271 from giuseppe/rootless-skip-ns-resolution-on-old-kernels
rootless: skip NS_GET_PARENT on old kernels
This commit is contained in:
@ -169,6 +169,9 @@ func getUserNSFirstChild(fd uintptr) (*os.File, error) {
|
|||||||
for {
|
for {
|
||||||
nextFd, err := getParentUserNs(fd)
|
nextFd, err := getParentUserNs(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == syscall.ENOTTY {
|
||||||
|
return os.NewFile(fd, "userns child"), nil
|
||||||
|
}
|
||||||
return nil, errors.Wrapf(err, "cannot get parent user namespace")
|
return nil, errors.Wrapf(err, "cannot get parent user namespace")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user