Skip to content

Commit 055c827

Browse files
committed
allow non-western characters in usernames
1 parent 9c420a1 commit 055c827

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/sudoers/test/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ fn invalid_username() {
364364
parse_eval::<ast::Sudo>("User_Alias FOO = $dollar");
365365
}
366366

367+
#[test]
368+
fn inclusive_username() {
369+
parse_eval::<ast::UserSpecifier>("şirin");
370+
}
371+
367372
#[test]
368373
fn directive_test() {
369374
let y = parse_eval::<Spec<UserSpecifier>>;

src/sudoers/tokens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Token for Username {
2424
}
2525

2626
fn accept(c: char) -> bool {
27-
c.is_ascii_alphanumeric() || ".-_@$".contains(c)
27+
c.is_alphanumeric() || ".-_@$".contains(c)
2828
}
2929

3030
fn accept_1st(c: char) -> bool {

0 commit comments

Comments
 (0)