Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
| ... | ... |
@@ -143,10 +143,12 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
| 143 | 143 |
}() |
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 |
- // Set sticky bit if XDG_RUNTIME_DIR is set && the file is actually under XDG_RUNTIME_DIR |
|
| 147 |
- if _, err := homedir.StickRuntimeDirContents(potentiallyUnderRuntimeDir); err != nil {
|
|
| 148 |
- // StickRuntimeDirContents returns nil error if XDG_RUNTIME_DIR is just unset |
|
| 149 |
- logrus.WithError(err).Warn("cannot set sticky bit on files under XDG_RUNTIME_DIR")
|
|
| 146 |
+ if cli.Config.IsRootless() {
|
|
| 147 |
+ // Set sticky bit if XDG_RUNTIME_DIR is set && the file is actually under XDG_RUNTIME_DIR |
|
| 148 |
+ if _, err := homedir.StickRuntimeDirContents(potentiallyUnderRuntimeDir); err != nil {
|
|
| 149 |
+ // StickRuntimeDirContents returns nil error if XDG_RUNTIME_DIR is just unset |
|
| 150 |
+ logrus.WithError(err).Warn("cannot set sticky bit on files under XDG_RUNTIME_DIR")
|
|
| 151 |
+ } |
|
| 150 | 152 |
} |
| 151 | 153 |
|
| 152 | 154 |
serverConfig, err := newAPIServerConfig(cli) |