smbconf: only include smbconf headers where needed.
[samba.git] / source3 / libnet / libnet_join.c
index cd476868e302c2d6c4b57b85a2d473d6140dee4a..7d19c63d757235c8b1a2ef179f589c06650d15c2 100644 (file)
 #include "includes.h"
 #include "libnet/libnet.h"
 #include "libcli/auth/libcli_auth.h"
+#include "../librpc/gen_ndr/cli_samr.h"
+#include "../librpc/gen_ndr/cli_lsa.h"
+#include "../librpc/gen_ndr/cli_netlogon.h"
+#include "lib/smbconf/smbconf.h"
+#include "lib/smbconf/smbconf_reg.h"
 
 /****************************************************************
 ****************************************************************/
@@ -789,6 +794,7 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx,
        E_md4hash(trust_passwd, orig_trust_passwd_hash);
 
        status = rpccli_netlogon_set_trust_password(pipe_hnd, mem_ctx,
+                                                   r->in.machine_name,
                                                    orig_trust_passwd_hash,
                                                    r->in.machine_password,
                                                    new_trust_passwd_hash,
@@ -1828,7 +1834,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
                                "failed to find DC for domain %s",
                                r->in.domain_name,
                                get_friendly_nt_error_msg(status));
-                       return WERR_DC_NOT_FOUND;
+                       return WERR_DCNOTFOUND;
                }
 
                dc = strip_hostname(info->dc_unc);
@@ -2019,7 +2025,7 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
                                "failed to find DC for domain %s",
                                r->in.domain_name,
                                get_friendly_nt_error_msg(status));
-                       return WERR_DC_NOT_FOUND;
+                       return WERR_DCNOTFOUND;
                }
 
                dc = strip_hostname(info->dc_unc);