Skip to content

Commit 7a80448

Browse files
authored
Merge pull request containerd#10516 from etungsten/ensure-state-dir-perms
Ensure /run/containerd gets created with correct perms
2 parents babfebf + 551ac06 commit 7a80448

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/containerd/server/server.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ func CreateTopLevelDirectories(config *srvconfig.Config) error {
8888
if err := sys.MkdirAllWithACL(config.State, 0o711); err != nil {
8989
return err
9090
}
91+
if config.State != defaults.DefaultStateDir {
92+
// XXX: socketRoot in pkg/shim is hard-coded to the default state directory.
93+
// See https://github.com/containerd/containerd/issues/10502#issuecomment-2249268582 for why it's set up that way.
94+
// The default fifo directory in pkg/cio is also configured separately and defaults to the default state directory instead of the configured state directory.
95+
// Make sure the default state directory is created with the correct permissions.
96+
if err := sys.MkdirAllWithACL(defaults.DefaultStateDir, 0o711); err != nil {
97+
return err
98+
}
99+
}
91100

92101
if config.TempDir != "" {
93102
if err := sys.MkdirAllWithACL(config.TempDir, 0o711); err != nil {

0 commit comments

Comments
 (0)