s3-winbindd: libwbclient: implement secure channel verification for specific domains...
authorGünther Deschner <gd@samba.org>
Tue, 6 Oct 2009 15:46:25 +0000 (17:46 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 7 Oct 2009 09:18:18 +0000 (11:18 +0200)
Guenther

source3/winbindd/winbindd_check_machine_acct.c
source3/winbindd/winbindd_dual_srv.c

index e3505cb35238b593b87c87eadd86d16cd8e46cf7..610e9edfaaca30f72c2bdfc343f267892ee26070 100644 (file)
@@ -42,7 +42,16 @@ struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       domain = find_our_domain();
+       if (request->domain_name[0] == '0') {
+               /* preserve old behavior, when no domain name is given */
+               domain = find_our_domain();
+       } else {
+               domain = find_domain_from_name(request->domain_name);
+       }
+       if (domain == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_SUCH_DOMAIN);
+               return tevent_req_post(req, ev);
+       }
        if (domain->internal) {
                /*
                 * Internal domains are passdb based, we can always
index 179a77106660c894fa929d33f344eaa636e2f6b7..337486107f6dfa6067e600e270e0369b01f070b8 100644 (file)
@@ -437,13 +437,13 @@ again:
        /* Pass back result code - zero for success, other values for
           specific failures. */
 
-       DEBUG(3, ("secret is %s\n", NT_STATUS_IS_OK(status) ?
-                  "good" : "bad"));
+       DEBUG(3,("domain %s secret is %s\n", domain->name,
+               NT_STATUS_IS_OK(status) ? "good" : "bad"));
 
  done:
        DEBUG(NT_STATUS_IS_OK(status) ? 5 : 2,
-             ("Checking the trust account password returned %s\n",
-              nt_errstr(status)));
+             ("Checking the trust account password for domain %s returned %s\n",
+              domain->name, nt_errstr(status)));
 
        return status;
 }