engine: resources: sysctl: Be more careful about dir path
More validation is not bad!
This commit is contained in:
@@ -47,6 +47,9 @@ import (
|
||||
func init() {
|
||||
engine.RegisterResource("sysctl", func() engine.Res { return &SysctlRes{} })
|
||||
|
||||
if !strings.HasPrefix(SysctlConfDir, "/") {
|
||||
panic("the SysctlConfDir does not start with a slash")
|
||||
}
|
||||
if !strings.HasSuffix(SysctlConfDir, "/") {
|
||||
panic("the SysctlConfDir does not end with a slash")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user