diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-05 17:50:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 17:50:37 +0100 |
commit | cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0 (patch) | |
tree | 67523c28abe72177ca0138655e897eddacb656e0 /cmd/podman/main.go | |
parent | 6902d9d9093e1d977ba733a182969bea3489dfbe (diff) | |
parent | f6d00ea6ef977bbaf167d1187d1e4e43632f6b5c (diff) | |
download | podman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.tar.gz podman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.tar.bz2 podman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.zip |
Merge pull request #12429 from cdoern/scp
podman image scp never enter podman user NS
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r-- | cmd/podman/main.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index b7f5f1720..b38734617 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -52,14 +52,14 @@ func parseCommands() *cobra.Command { // Command cannot be run rootless _, found := c.Command.Annotations[registry.UnshareNSRequired] if found { - if rootless.IsRootless() && os.Getuid() != 0 { + if rootless.IsRootless() && os.Getuid() != 0 && c.Command.Name() != "scp" { c.Command.RunE = func(cmd *cobra.Command, args []string) error { return fmt.Errorf("cannot run command %q in rootless mode, must execute `podman unshare` first", cmd.CommandPath()) } } } else { _, found = c.Command.Annotations[registry.ParentNSRequired] - if rootless.IsRootless() && found { + if rootless.IsRootless() && found && c.Command.Name() != "scp" { c.Command.RunE = func(cmd *cobra.Command, args []string) error { return fmt.Errorf("cannot run command %q in rootless mode", cmd.CommandPath()) } |