summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-09 14:48:33 -0700
committerGitHub <noreply@github.com>2019-10-09 14:48:33 -0700
commit12c9b53439d958395856c29567ec0ed44a5507ed (patch)
treee3f080786bc17228dc1a4a1f3ceef04b64a70fa9 /libpod
parent2bf184aa019387de560bec60636ae5152f8b54ce (diff)
parent2ceb03d05e6cf365963ab9d3d8af45158097e906 (diff)
downloadpodman-12c9b53439d958395856c29567ec0ed44a5507ed.tar.gz
podman-12c9b53439d958395856c29567ec0ed44a5507ed.tar.bz2
podman-12c9b53439d958395856c29567ec0ed44a5507ed.zip
Merge pull request #4225 from giuseppe/rootless-create-pause-automatically
rootless: automatically recreate the pause.pid file
Diffstat (limited to 'libpod')
-rw-r--r--libpod/boltdb_state.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go
index e43d54eee..0bb1df7b8 100644
--- a/libpod/boltdb_state.go
+++ b/libpod/boltdb_state.go
@@ -2,6 +2,7 @@ package libpod
import (
"bytes"
+ "os"
"strings"
"sync"
@@ -658,9 +659,13 @@ func (s *BoltState) UpdateContainer(ctr *Container) error {
return err
}
- // Handle network namespace
- if err := replaceNetNS(netNSPath, ctr, newState); err != nil {
- return err
+ // Handle network namespace.
+ if os.Geteuid() == 0 {
+ // Do it only when root, either on the host or as root in the
+ // user namespace.
+ if err := replaceNetNS(netNSPath, ctr, newState); err != nil {
+ return err
+ }
}
// New state compiled successfully, swap it into the current state