diff options
author | Gerald Carter <jerry@samba.org> | 2006-05-12 15:17:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:57 -0500 |
commit | 2c029a8b96ae476f1d5c2abe14ee25f98a1513d8 (patch) | |
tree | d256cef6a5f4802549a599477c6bc8b4897d4ff0 /source3/utils/net_rpc_join.c | |
parent | fc5f948260477e4c43e844be1abb09056174d69e (diff) | |
download | samba-2c029a8b96ae476f1d5c2abe14ee25f98a1513d8.tar.gz samba-2c029a8b96ae476f1d5c2abe14ee25f98a1513d8.tar.bz2 samba-2c029a8b96ae476f1d5c2abe14ee25f98a1513d8.zip |
r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.
The points of interest are
* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
using the machine account after the join
Thanks to Guenther and Simo for the review.
Still to do:
* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
'kinit -k' (although we might be able to just use the sAMAccountName
instead)
* Re-add support for pre-creating the machine account in
a specific OU
(This used to be commit 4c4ea7b20f44cd200cef8c7b389d51b72eccc39b)
Diffstat (limited to 'source3/utils/net_rpc_join.c')
-rw-r--r-- | source3/utils/net_rpc_join.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index d611940e65..2c55b0e946 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -41,7 +41,7 @@ * @return A shell status integer (0 for success) * **/ -static int net_rpc_join_ok(const char *domain) +int net_rpc_join_ok(const char *domain, const char *server, struct in_addr *ip ) { uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS|NETLOGON_NEG_SCHANNEL; struct cli_state *cli = NULL; @@ -50,7 +50,7 @@ static int net_rpc_join_ok(const char *domain) NTSTATUS ntret = NT_STATUS_UNSUCCESSFUL; /* Connect to remote machine */ - if (!(cli = net_make_ipc_connection(NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC))) { + if (!(cli = net_make_ipc_connection_ex(domain, server, ip, (NET_FLAGS_ANONYMOUS|NET_FLAGS_PDC)))) { return -1; } @@ -402,7 +402,7 @@ int net_rpc_join_newstyle(int argc, const char **argv) } /* double-check, connection from scratch */ - retval = net_rpc_join_ok(domain); + retval = net_rpc_join_ok(domain, cli->desthost, &cli->dest_ip); done: @@ -434,7 +434,7 @@ int net_rpc_testjoin(int argc, const char **argv) char *domain = smb_xstrdup(opt_target_workgroup); /* Display success or failure */ - if (net_rpc_join_ok(domain) != 0) { + if (net_rpc_join_ok(domain, NULL, NULL) != 0) { fprintf(stderr,"Join to domain '%s' is not valid\n",domain); free(domain); return -1; |