Skip to content

Commit

Permalink
Fix bug where podman mount didn't error as rootless
Browse files Browse the repository at this point in the history
We require that rootless `podman mount` be run inside a shell
spawned by `podman unshare` (which gives us a mount namespace
which actually lets other commands use the mounted filesystem).

The fix is simple - we need to mark the command as requiring the
rootless user namespace not be configured, so we can test for it
later as part of the mount code and error if we needed to make
one.

Fixes containers#6856

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
mheon authored and skorhone committed Jul 7, 2020
1 parent bb1c272 commit f5d070c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cmd/podman/containers/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ var (
Args: func(cmd *cobra.Command, args []string) error {
return validate.CheckAllLatestAndCIDFile(cmd, args, true, false)
},
Annotations: map[string]string{
registry.ParentNSRequired: "",
},
}

containerMountCommmand = &cobra.Command{
Use: mountCommand.Use,
Short: mountCommand.Short,
Long: mountCommand.Long,
RunE: mountCommand.RunE,
Use: mountCommand.Use,
Short: mountCommand.Short,
Long: mountCommand.Long,
RunE: mountCommand.RunE,
Args: mountCommand.Args,
Annotations: mountCommand.Annotations,
}
)

Expand Down

0 comments on commit f5d070c

Please sign in to comment.