Add config permissions

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
Mauro Morales 2023-12-06 14:37:20 +01:00
parent 6e1d761ded
commit 287c64cdcb
2 changed files with 2 additions and 1 deletions

View File

@ -94,6 +94,7 @@ const (
// Default directory and file fileModes
DirPerm = os.ModeDir | os.ModePerm
FilePerm = 0666
ConfigPerm = 0640 // Used for config files that contain secrets or other sensitive data
NoWriteDirPerm = 0555 | os.ModeDir
TempDirPerm = os.ModePerm | os.ModeSticky | os.ModeDir

View File

@ -401,7 +401,7 @@ func (e *Elemental) CopyCloudConfig(cloudInit []string) (err error) {
if err != nil {
return err
}
if err = e.config.Fs.Chmod(customConfig, cnst.FilePerm); err != nil {
if err = e.config.Fs.Chmod(customConfig, cnst.ConfigPerm); err != nil {
e.config.Logger.Debugf("Error on chmod %s: %s\n", customConfig, err.Error())
return err
}