r7756: Don't segfault by trying to search for the NULL DN, if the wrong
authorAndrew Bartlett <abartlet@samba.org>
Sun, 19 Jun 2005 12:55:46 +0000 (12:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:31 +0000 (13:18 -0500)
password was entered.  We would not use the results of the search in
any case.

Andrew Bartlett
(This used to be commit edeb908acaaaaab13bef4d2e3fae18d87c07af81)

source4/rpc_server/samr/samr_password.c

index e7f547bbf30c743d46cca663e419de8ad82a3e4b..8fa261cf35d76d029a465fa4f6ae5b0a07a1be8e 100644 (file)
@@ -400,11 +400,13 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
        return NT_STATUS_OK;
 
 failed:
-       ret = gendb_search_dn(sam_ctx, mem_ctx,
-                             domain_dn, &res, dom_attrs);
-
-       if (ret != 1) {
-               return status;
+       if (domain_dn) {
+               ret = gendb_search_dn(sam_ctx, mem_ctx,
+                                     domain_dn, &res, dom_attrs);
+               
+               if (ret != 1) {
+                       return status;
+               }
        }
 
        /* on failure we need to fill in the reject reasons */