Fix SMB negotiate: cipher_count=1 and username case sensitivity

This commit is contained in:
Warren
2026-06-24 22:22:42 +08:00
parent dc217e8903
commit 6f223c9232
3 changed files with 10 additions and 9 deletions
+4 -3
View File
@@ -75,9 +75,10 @@ impl Share {
}
/// Grant `access` to the given (already-registered) user. Multiple calls
/// accumulate.
/// accumulate. Username is normalized to lowercase for SMB case-insensitive
/// matching.
pub fn user(mut self, name: impl Into<String>, access: Access) -> Self {
self.users.insert(name.into(), access);
self.users.insert(name.into().to_lowercase(), access);
self
}
@@ -163,7 +164,7 @@ impl SmbServerBuilder {
}
pub fn user(mut self, name: impl Into<String>, password: impl Into<String>) -> Self {
let n = name.into();
let n = name.into().to_lowercase();
if !self.users.contains_key(&n) {
self.user_order.push(n.clone());
}