Skip to content

Commit 2b35e17

Browse files
committed
runc's config.json doesn't have to be readable from others
It won't contain any sensitive values though. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent e0a0251 commit 2b35e17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/runc_jailer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (j *runcJailer) BuildJailedRootHandler(cfg *Config, socketPath *string, vmI
131131

132132
rootPathToConfig := filepath.Join(ociBundlePath, "config.json")
133133
j.logger.WithField("rootPathToConfig", rootPathToConfig).Debug("Copying config")
134-
if err := copyFile(runcConfigPath, rootPathToConfig, 0444); err != nil {
134+
if err := copyFile(runcConfigPath, rootPathToConfig, 0400); err != nil {
135135
return errors.Wrapf(err, "failed to copy config from %v to %v", runcConfigPath, rootPathToConfig)
136136
}
137137

@@ -392,7 +392,7 @@ func (j runcJailer) overwriteConfig(cfg *Config, socketPath, configPath string)
392392
return err
393393
}
394394

395-
if err := ioutil.WriteFile(configPath, configBytes, 0444); err != nil {
395+
if err := ioutil.WriteFile(configPath, configBytes, 0400); err != nil {
396396
return err
397397
}
398398

0 commit comments

Comments
 (0)