GroupRemoveSuffix = GroupSpecialSeparator + "remove"
)
-// Keep in sync with sync_info.go:infoGroupDetectedRegexp
+// Keep in sync with cmd/safcm/sync_info.go:infoGroupDetectedRegexp
var groupNameRegexp = regexp.MustCompile(`^[a-z0-9_-]+$`)
func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
if x == GroupAll {
continue
}
+ // Don't validate against groupNameRegexp because
+ // hosts have less strict restrictions.
if strings.Contains(x, GroupSpecialSeparator) {
return nil, fmt.Errorf(
"%s member %q must not contain %q",
return groups, nil
}
-func ResolveHostGroups(host string,
- groups map[string][]string,
+func ResolveHostGroups(host string, groups map[string][]string,
detectedGroups []string) ([]string, error) {
const maxDepth = 100