aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/args.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/args.rs b/src/args.rs
index f858308..5a0b5db 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -89,6 +89,7 @@ fn parse_auth(src: &str) -> Result<(String, String), String> {
};
let password = match split.next() {
+ // This allows empty passwords, as the spec does not forbid it
Some(password) => password,
None => {
return Err(
@@ -96,10 +97,12 @@ fn parse_auth(src: &str) -> Result<(String, String), String> {
)
}
};
- // Should we allow empty passwords ?
- if username.len() > 255 {
- return Err("Username length cannot exceed 255 characters".to_owned());
+ // To make it Windows-compatible,the password needs to be shorter than 255 characters.
+ // After 255 characters, Windows will truncate the value.
+ // As for the username, the spec does not mention a limit in length
+ if password.len() > 255 {
+ return Err("Password length cannot exceed 255 characters".to_owned());
}
Ok((username.to_owned(), password.to_owned()))