Commit 21f3bd95 authored by grahame's avatar grahame

escape username when building LDAP query

parent 36c53318
Pipeline #219 failed with stages
in 2 seconds
...@@ -23,7 +23,7 @@ pub fn ldap_search(username: &str) -> Option<LDAPUser> { ...@@ -23,7 +23,7 @@ pub fn ldap_search(username: &str) -> Option<LDAPUser> {
.search( .search(
"cn=Users,dc=ad,dc=ucc,dc=gu,dc=uwa,dc=edu,dc=au", "cn=Users,dc=ad,dc=ucc,dc=gu,dc=uwa,dc=edu,dc=au",
Scope::Subtree, Scope::Subtree,
&format!("(cn={})", username), &format!("(cn={})", ldap3::ldap_escape(username)),
vec!["when_created", "displayName", "name"], vec!["when_created", "displayName", "name"],
) )
.expect("LDAP error") .expect("LDAP error")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment