Skip to content

Commit

Permalink
asserts: update username regex allowed by system-user assertion (cano…
Browse files Browse the repository at this point in the history
…nical#13590)

* asserts: update username regex allowed by system-user assertion

* asserts: drop the second '-' from the regex
  • Loading branch information
Meulengracht authored Feb 16, 2024
1 parent 5407316 commit 4f18d96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion asserts/system_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import (
"time"
)

var validSystemUserUsernames = regexp.MustCompile(`^[a-z0-9][-a-z0-9+.-_]*$`)
// validSystemUserUsernames matches the regex we allow by osutil/user.go:IsValidUsername
var validSystemUserUsernames = regexp.MustCompile(`^[a-z0-9][-a-z0-9._]*$`)

// SystemUser holds a system-user assertion which allows creating local
// system users.
Expand Down

0 comments on commit 4f18d96

Please sign in to comment.