summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-08-26 12:47:10 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-10-02 10:12:58 +0200
commit4f7da3274baed18c3eaf0a1329501d528e224436 (patch)
tree88658095e22fc92f6f011217f4723b2caf513618 /pkg
parentdefd427503c2b36d64686b6ef327ce16810855c1 (diff)
downloadpodman-4f7da3274baed18c3eaf0a1329501d528e224436.tar.gz
podman-4f7da3274baed18c3eaf0a1329501d528e224436.tar.bz2
podman-4f7da3274baed18c3eaf0a1329501d528e224436.zip
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>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/config_linux.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go
index 1d5dcd8e7..fac02ad01 100644
--- a/pkg/specgen/generate/config_linux.go
+++ b/pkg/specgen/generate/config_linux.go
@@ -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)