1
0
mirror of https://github.com/coreos/ignition.git synced 2026-02-06 18:47:54 +01:00

config: add warnings for unspecified file/dir modes

When the mode is unspecified on a file or directory it defaults to 0.
Add warnings to inform users of this.
This commit is contained in:
Derek Gonyeo
2018-01-04 13:59:25 -08:00
parent c9db893ede
commit 424f37b755
2 changed files with 12 additions and 0 deletions

View File

@@ -26,5 +26,11 @@ func (d Directory) ValidateMode() report.Report {
Kind: report.EntryError,
})
}
if d.Mode == nil {
r.Add(report.Entry{
Message: "directory permissions unset, defaulting to 0000",
Kind: report.EntryWarning,
})
}
return r
}

View File

@@ -33,6 +33,12 @@ func (f File) ValidateMode() report.Report {
Kind: report.EntryError,
})
}
if f.Mode == nil {
r.Add(report.Entry{
Message: "file permissions unset, defaulting to 0000",
Kind: report.EntryWarning,
})
}
return r
}