-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
In version v2.2.1 used in RHEL8, podman does not work anymore for rootless containers if the storage path is a symbolic link to some directory crossing file system boundaries.
Steps to reproduce the issue:
-
install podman, keep default configuration, the rootless storage path is below the user's home directory
-
link some directory from a different file system to .local/share/containers/storage
-
remove .local/share/containers/storage/libpod and run podman info
Describe the results you received:
Error: remount /home/USER/.local/share/containers/storage/overlay, flags: 0x40000: invalid argument
Same with all other subcommands.
Describe the results you expected:
no error
Additional information you deem important (e.g. issue happens only occasionally):
The cause may be a change in vendor/github.com/containers/storage/utils.go:
@@ -206,11 +206,10 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti
opts.RunRoot = rootlessRuntime
- opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
if systemOpts.RootlessStoragePath != "" {
- opts.RootlessStoragePath = systemOpts.RootlessStoragePath
+ opts.GraphRoot = systemOpts.RootlessStoragePath
} else {
- opts.RootlessStoragePath = opts.GraphRoot
+ opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
}
opts.GraphRoot, err = filepath.EvalSymlinks(opts.GraphRoot) // ----- HELPS ---
if path, err := exec.LookPath("fuse-overlayfs"); err == nil {
opts.GraphDriverName = "overlay"
The line marked with // ---- HELPS --- makes podman work again.
Output of podman version:
Version: 2.2.1
API Version: 2
Go Version: go1.14.12
Built: Sun Feb 21 23:51:35 2021
OS/Arch: linux/amd64
if link was removed