Committed by
Gerrit Code Review
Allow - in Warden user name
- POSIX user name allows . and - in addition to character class \w http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_431 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278 https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#sum Change-Id: I5529ee0d89be0bcc3b92f955d09834e30cbcfea4
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -169,7 +169,7 @@ class Warden { | ... | @@ -169,7 +169,7 @@ class Warden { |
169 | synchronized String borrowCell(String userName, String sshKey, int minutes, | 169 | synchronized String borrowCell(String userName, String sshKey, int minutes, |
170 | String cellSpec) { | 170 | String cellSpec) { |
171 | checkNotNull(userName, USER_NOT_NULL); | 171 | checkNotNull(userName, USER_NOT_NULL); |
172 | - checkArgument(userName.matches("[\\w]+"), "Invalid user name %s", userName); | 172 | + checkArgument(userName.matches("[\\w.-]+"), "Invalid user name %s", userName); |
173 | checkNotNull(sshKey, KEY_NOT_NULL); | 173 | checkNotNull(sshKey, KEY_NOT_NULL); |
174 | checkArgument(minutes < MAX_MINUTES, "Number of minutes must be less than %d", MAX_MINUTES); | 174 | checkArgument(minutes < MAX_MINUTES, "Number of minutes must be less than %d", MAX_MINUTES); |
175 | checkArgument(minutes >= 0, "Number of minutes must be non-negative"); | 175 | checkArgument(minutes >= 0, "Number of minutes must be non-negative"); | ... | ... |
-
Please register or login to post a comment