mirror of
https://github.com/samba-team/samba.git
synced 2025-03-12 20:58:37 +03:00
s4-samr: Escape the username in the LDAP filter
Change-Id: I99945f0b86ea2862c88c00ad39c809ef1101ca9b Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
f557f82acc
commit
a6b82ee197
@ -102,7 +102,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
|
||||
ret = gendb_search(sam_ctx,
|
||||
mem_ctx, NULL, &res, attrs,
|
||||
"(&(sAMAccountName=%s)(objectclass=user))",
|
||||
r->in.account->string);
|
||||
ldb_binary_encode_string(mem_ctx, r->in.account->string));
|
||||
if (ret != 1) {
|
||||
/* Don't give the game away: (don't allow anonymous users to prove the existance of usernames) */
|
||||
return NT_STATUS_WRONG_PASSWORD;
|
||||
@ -249,7 +249,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
|
||||
ret = gendb_search(sam_ctx,
|
||||
mem_ctx, NULL, &res, attrs,
|
||||
"(&(sAMAccountName=%s)(objectclass=user))",
|
||||
r->in.account->string);
|
||||
ldb_binary_encode_string(mem_ctx, r->in.account->string));
|
||||
if (ret != 1) {
|
||||
/* Don't give the game away: (don't allow anonymous users to prove the existance of usernames) */
|
||||
status = NT_STATUS_WRONG_PASSWORD;
|
||||
|
Loading…
x
Reference in New Issue
Block a user