diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-08-29 10:24:50 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-29 16:25:20 +0000 |
commit | d8c2962188a8c6900e609c0dced5a662fcc18272 (patch) | |
tree | 7d3fabb74ad7d0b63e5776d5a6475c05d58c81c4 /cmd | |
parent | 86aefb5de25496ce8894bef73bec6e5d13fd3f47 (diff) | |
download | podman-d8c2962188a8c6900e609c0dced5a662fcc18272.tar.gz podman-d8c2962188a8c6900e609c0dced5a662fcc18272.tar.bz2 podman-d8c2962188a8c6900e609c0dced5a662fcc18272.zip |
rootless: show an error when pause/unpause are used
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1371
Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/main.go | 2 | ||||
-rw-r--r-- | cmd/podman/pause.go | 4 | ||||
-rw-r--r-- | cmd/podman/unpause.go | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 06d9308e0..538eaaac2 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -32,6 +32,8 @@ var cmdsNotRequiringRootless = map[string]bool{ "login": true, "logout": true, "kill": true, + "pause": true, + "unpause": true, "search": true, "stop": true, "top": true, diff --git a/cmd/podman/pause.go b/cmd/podman/pause.go index 12ff747a7..e8a576599 100644 --- a/cmd/podman/pause.go +++ b/cmd/podman/pause.go @@ -25,6 +25,10 @@ var ( ) func pauseCmd(c *cli.Context) error { + if os.Getuid() != 0 { + return errors.New("pause is not supported for rootless containers") + } + runtime, err := libpodruntime.GetRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") diff --git a/cmd/podman/unpause.go b/cmd/podman/unpause.go index d0c622b8a..d5b2732af 100644 --- a/cmd/podman/unpause.go +++ b/cmd/podman/unpause.go @@ -25,6 +25,10 @@ var ( ) func unpauseCmd(c *cli.Context) error { + if os.Getuid() != 0 { + return errors.New("unpause is not supported for rootless containers") + } + runtime, err := libpodruntime.GetRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") |