mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
dockerd: call StickRuntimeDirContents only in rootless mode
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
832ce62cb2
commit
56bea903ef
1 changed files with 6 additions and 4 deletions
|
@ -143,11 +143,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cli.Config.IsRootless() {
|
||||||
// Set sticky bit if XDG_RUNTIME_DIR is set && the file is actually under XDG_RUNTIME_DIR
|
// Set sticky bit if XDG_RUNTIME_DIR is set && the file is actually under XDG_RUNTIME_DIR
|
||||||
if _, err := homedir.StickRuntimeDirContents(potentiallyUnderRuntimeDir); err != nil {
|
if _, err := homedir.StickRuntimeDirContents(potentiallyUnderRuntimeDir); err != nil {
|
||||||
// StickRuntimeDirContents returns nil error if XDG_RUNTIME_DIR is just unset
|
// StickRuntimeDirContents returns nil error if XDG_RUNTIME_DIR is just unset
|
||||||
logrus.WithError(err).Warn("cannot set sticky bit on files under XDG_RUNTIME_DIR")
|
logrus.WithError(err).Warn("cannot set sticky bit on files under XDG_RUNTIME_DIR")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
serverConfig, err := newAPIServerConfig(cli)
|
serverConfig, err := newAPIServerConfig(cli)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue