Trim password loaded from file

This commit is contained in:
Dreaded_X 2025-04-14 17:42:02 +02:00
parent 1515ff236a
commit ddc3416f58
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA

View File

@ -33,7 +33,11 @@ impl Ldap {
std::env::var("LDAP_PASSWORD")
.map_err(|_| LdapError::MissingEnvironmentVariable("LDAP_PASSWORD"))
},
|path| std::fs::read_to_string(path).map_err(|err| err.into()),
|path| {
std::fs::read_to_string(path)
.map(|v| v.trim().into())
.map_err(|err| err.into())
},
)?;
let (conn, mut ldap) = LdapConnAsync::new(&address).await?;