mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
cmd: drop special handling for "scp"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -15,8 +15,7 @@ var (
|
||||
imageScpCommand = &cobra.Command{
|
||||
Use: "scp [options] IMAGE [HOST::]",
|
||||
Annotations: map[string]string{
|
||||
registry.UnshareNSRequired: "",
|
||||
registry.ParentNSRequired: "",
|
||||
registry.ParentNSRequired: "",
|
||||
},
|
||||
Long: saveScpDescription,
|
||||
Short: "securely copy images",
|
||||
|
@ -76,7 +76,7 @@ func parseCommands() *cobra.Command {
|
||||
// Command cannot be run rootless
|
||||
_, found := c.Command.Annotations[registry.UnshareNSRequired]
|
||||
if found {
|
||||
if rootless.IsRootless() && os.Getuid() != 0 && c.Command.Name() != "scp" {
|
||||
if rootless.IsRootless() && os.Getuid() != 0 {
|
||||
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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user