summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-10-20 10:29:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:04 -0500
commit9f672563835ee94b49e35bb932c514afacc712b2 (patch)
tree57026229a620420b1a14851cc61535b22d25f8ed /source4
parentb0c7c175b1c1ed45a31a710e4fbe18bbffdd6d38 (diff)
downloadsamba-9f672563835ee94b49e35bb932c514afacc712b2.tar.gz
samba-9f672563835ee94b49e35bb932c514afacc712b2.tar.bz2
samba-9f672563835ee94b49e35bb932c514afacc712b2.zip
r11221: I don't quite know how I tested this before, but clearly I didn't.
The samdb_set_password_sid helper function now works. Andrew Bartlett (This used to be commit 629595f27c3f721c4b317df871814ac5ba06be9c)
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/samr/samr_password.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c
index 2b04903ebd..acbb02a795 100644
--- a/source4/rpc_server/samr/samr_password.c
+++ b/source4/rpc_server/samr/samr_password.c
@@ -836,13 +836,14 @@ NTSTATUS samdb_set_password_sid(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
NTSTATUS nt_status;
struct ldb_dn *user_dn;
struct ldb_message *msg;
- int count;
int ret;
user_dn = samdb_search_dn(ctx, mem_ctx, NULL,
- "((objectSid=%s)(objectClass=user))",
+ "(&(objectSid=%s)(objectClass=user))",
ldap_encode_ndr_dom_sid(mem_ctx, user_sid));
- if (count != 1) {
+ if (!user_dn) {
+ DEBUG(3, ("samdb_set_password_sid: SID %s not found in samdb, returning NO_SUCH_USER\n",
+ dom_sid_string(mem_ctx, user_sid)));
return NT_STATUS_NO_SUCH_USER;
}