diff --git a/pkg/osutil/user.go b/pkg/osutil/user.go index 3cd605dcaa2c..7474296bca3e 100644 --- a/pkg/osutil/user.go +++ b/pkg/osutil/user.go @@ -35,8 +35,10 @@ var ( // regexUsername matches user and group names to be valid for `useradd`. // `useradd` allows names with a trailing '$', but it feels prudent to map those // names to the fallback user as well, so the regex does not allow them. -var regexUsername = regexp.MustCompile("^[a-z_][a-z0-9_-]*$") -var notAllowedUsernameRegex = regexp.MustCompile(`^admin$`) +var ( + regexUsername = regexp.MustCompile("^[a-z_][a-z0-9_-]*$") + notAllowedUsernameRegex = regexp.MustCompile(`^admin$`) +) // regexPath detects valid Linux path. var regexPath = regexp.MustCompile("^[/a-zA-Z0-9_-]+$")