cmd/root: Protect against future programmer errors

https://github.com/containers/toolbox/pull/1202
This commit is contained in:
Debarshi Ray 2022-12-15 23:43:34 +01:00
parent 446d7bfdef
commit 2d1eff8f12
1 changed files with 4 additions and 0 deletions

View File

@ -393,6 +393,10 @@ func setUpLoggers() error {
}
func validateSubIDFile(path string) (bool, error) {
if utils.IsInsideContainer() {
panic("cannot validate sub-IDs inside container")
}
logrus.Debugf("Validating sub-ID file %s", path)
file, err := os.Open(path)