mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
rootless: drop permission check for devices
commit 350ede1eeb6ab33bce2918d7768b940c255e63c6 added the feature. Do not check whether the device is usable by the rootless user before adding to the container. Closes: https://github.com/containers/podman/issues/12704 [NO NEW TESTS NEEDED] it requires changes on the host to test it Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -47,17 +47,6 @@ func addPrivilegedDevices(g *generate.Generator) error {
|
|||||||
if _, found := mounts[d.Path]; found {
|
if _, found := mounts[d.Path]; found {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
st, err := os.Stat(d.Path)
|
|
||||||
if err != nil {
|
|
||||||
if err == unix.EPERM {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// Skip devices that the user has not access to.
|
|
||||||
if st.Mode()&0007 == 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
newMounts = append(newMounts, devMnt)
|
newMounts = append(newMounts, devMnt)
|
||||||
}
|
}
|
||||||
g.Config.Mounts = append(newMounts, g.Config.Mounts...)
|
g.Config.Mounts = append(newMounts, g.Config.Mounts...)
|
||||||
|
Reference in New Issue
Block a user