mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
spec: open fuse with --device .*/fuse
If the container uses the /dev/fuse device, attempt to load the fuse kernel module first so that nested containers can use it. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1872240 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -248,6 +248,13 @@ func addDevice(g *generate.Generator, device string) error {
|
||||
}
|
||||
g.Config.Mounts = append(g.Config.Mounts, devMnt)
|
||||
return nil
|
||||
} else if src == "/dev/fuse" {
|
||||
// if the user is asking for fuse inside the container
|
||||
// make sure the module is loaded.
|
||||
f, err := unix.Open(src, unix.O_RDONLY|unix.O_NONBLOCK, 0)
|
||||
if err == nil {
|
||||
unix.Close(f)
|
||||
}
|
||||
}
|
||||
dev.Path = dst
|
||||
g.AddDevice(*dev)
|
||||
|
Reference in New Issue
Block a user