summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-28 20:01:32 +0100
committerGünther Deschner <gd@samba.org>2008-02-28 20:06:09 +0100
commit781e1ab4a1d9c5fe581034d42c9c597cd5d7be4d (patch)
treee5dfc2dae14f3a5e6c954005ea6dd64e655d53b7 /source3
parent27310f0768f734f68f4c48d6b2c2cc441a0a434c (diff)
downloadsamba-781e1ab4a1d9c5fe581034d42c9c597cd5d7be4d.tar.gz
samba-781e1ab4a1d9c5fe581034d42c9c597cd5d7be4d.tar.bz2
samba-781e1ab4a1d9c5fe581034d42c9c597cd5d7be4d.zip
Re-enable _wkssvc_NetrJoinDomain2 remote join implementation now that we are ready for it.
"netdom join SAMBAHOST" from a windows workstation nicely demonstrates it. Guenther (This used to be commit 3bcaa3582a101abc17f7c21128e01024af877577)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_wkssvc_nt.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c
index 43bd20d2d7..e559248ef8 100644
--- a/source3/rpc_server/srv_wkssvc_nt.c
+++ b/source3/rpc_server/srv_wkssvc_nt.c
@@ -281,11 +281,12 @@ WERROR _wkssvc_NetrGetJoinableOus(pipes_struct *p, struct wkssvc_NetrGetJoinable
}
/********************************************************************
+ _wkssvc_NetrJoinDomain2
********************************************************************/
-WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r)
+WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p,
+ struct wkssvc_NetrJoinDomain2 *r)
{
-#if 0
struct libnet_JoinCtx *j = NULL;
char *cleartext_pwd = NULL;
char *admin_domain = NULL;
@@ -302,6 +303,8 @@ WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r
if (!user_has_privileges(token, &se_machine_account) &&
!nt_token_check_domain_rid(token, DOMAIN_GROUP_RID_ADMINS) &&
!nt_token_check_domain_rid(token, BUILTIN_ALIAS_RID_ADMINS)) {
+ DEBUG(5,("_wkssvc_NetrJoinDomain2: account doesn't have "
+ "sufficient privileges\n"));
return WERR_ACCESS_DENIED;
}
@@ -341,16 +344,20 @@ WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r
j->in.join_flags = r->in.join_flags;
j->in.admin_account = admin_account;
j->in.admin_password = cleartext_pwd;
- j->in.modify_config = true;
+ j->in.debug = true;
become_root();
werr = libnet_Join(p->mem_ctx, j);
unbecome_root();
+ if (!W_ERROR_IS_OK(werr)) {
+ DEBUG(5,("_wkssvc_NetrJoinDomain2: libnet_Join gave %s\n",
+ j->out.error_string ? j->out.error_string :
+ dos_errstr(werr)));
+ }
+
+ TALLOC_FREE(j);
return werr;
-#endif
- p->rng_fault_state = True;
- return WERR_NOT_SUPPORTED;
}
/********************************************************************