diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-30 13:27:42 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-30 13:27:42 +0000 |
commit | 2edcc96c11c1f5c9294f1730973e7582b3a3acbd (patch) | |
tree | 1ed731efe49199372d33948790dc816f2e90b89a | |
parent | 0bd3a76f673de93dac4fa18a60612bc888c05df4 (diff) | |
download | samba-2edcc96c11c1f5c9294f1730973e7582b3a3acbd.tar.gz samba-2edcc96c11c1f5c9294f1730973e7582b3a3acbd.tar.bz2 samba-2edcc96c11c1f5c9294f1730973e7582b3a3acbd.zip |
a couple more minor tweaks. This now allows us to operate in ADS mode
without any 'realm =' or 'ads server =' options at all, as long as DNS
is working right.
(This used to be commit d3fecdd04241ed7b9248e52415693cd54a1faecf)
-rw-r--r-- | source3/auth/auth_domain.c | 7 | ||||
-rw-r--r-- | source3/libads/ads_struct.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index d0b5b4db7f..f74f1bb9e8 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -37,8 +37,7 @@ extern userdom_struct current_user_info; Note that we ignore the 'server' parameter here. That has the effect of using the 'ADS server' smb.conf parameter, which is what we really want anyway */ -static NTSTATUS ads_resolve_dc(const char *server, - fstring remote_machine, +static NTSTATUS ads_resolve_dc(fstring remote_machine, struct in_addr *dest_ip) { ADS_STRUCT *ads; @@ -132,7 +131,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, NTSTATUS result; if (lp_security() == SEC_ADS) { - result = ads_resolve_dc(server, remote_machine, &dest_ip); + result = ads_resolve_dc(remote_machine, &dest_ip); } else { result = rpc_resolve_dc(server, remote_machine, &dest_ip); } @@ -366,7 +365,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, while (!NT_STATUS_IS_OK(nt_status) && next_token(&server,remote_machine,LIST_SEP,sizeof(remote_machine))) { - if(strequal(remote_machine, "*")) { + if(lp_security() != SEC_ADS && strequal(remote_machine, "*")) { nt_status = find_connect_pdc(&cli, domain, setup_creds_as, sec_chan, trust_passwd, last_change_time); } else { nt_status = connect_to_domain_password_server(&cli, remote_machine, setup_creds_as, sec_chan, trust_passwd); diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 638dc0b22e..0be79673a0 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -148,6 +148,12 @@ ADS_STRUCT *ads_init(const char *realm, SAFE_FREE(ads->realm); } } + + if (!ads->realm && strchr_m(ads->workgroup, '.')) { + /* the smb.conf has specified the realm in 'workgroup =' */ + ads->realm = strdup(ads->workgroup); + } + if (!ads->bind_path && ads->realm) { ads->bind_path = ads_build_dn(ads->realm); } |