summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/main.go2
-rw-r--r--cmd/podman/pause.go4
-rw-r--r--cmd/podman/unpause.go4
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")