diff --git a/internal/config/validationutil/validationutil.go b/internal/config/validationutil/validationutil.go index a8920ad..4541d41 100644 --- a/internal/config/validationutil/validationutil.go +++ b/internal/config/validationutil/validationutil.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "regexp" + "strings" ) var ( @@ -26,6 +27,9 @@ func SanitizeID(id string) string { // It returns an error if the ID contains invalid characters, is empty, or is too long. // The maxLen parameter is the maximum length of the ID. If maxLen is 0, the ID length is not checked. func ValidateID(id string, maxLen int) error { + if strings.HasPrefix(id, "__") && strings.HasSuffix(id, "__") { + return errors.New("IDs starting and ending with '__' are reserved by backrest") + } if !idRegex.MatchString(id) { return ErrInvalidChars }