[SCM] Samba Shared Repository - branch master updated
Matthias Dieter Wallnöfer
mdw at samba.org
Tue Apr 27 10:50:21 MDT 2010
The branch, master has been updated
via d1db751... Revert "s4:web_server: use tsocket_address functions to get the local ip and port"
via 79a29a8... s4:cldap_server/netlogon.c - handle the domain SID correctly
via eceffe6... nbt: samlogon/netlogon structures - unify denominations
via 3f1bd92... s4:fill_netlogon_samlogon_response - reorder assign operations (to be consistent)
via a89ba9e... s4:fill_netlogon_samlogon_response - use "lp_workgroup" for the short netbios domainname
via 7efb436... s4:torture - DsRAddressToSitenames[Ex]W testsuite - make it IPv4-only compatible
from 8f8e7c7... Revert "s3-build: Remove --enable-merged support."
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit d1db751ff8e6b15c059db254b57c72dfda8d4bfc
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 18:25:21 2010 +0200
Revert "s4:web_server: use tsocket_address functions to get the local ip and port"
This reverts commit 9a1a00199c2603376eacfdba7e7d0d55bc64f405.
This broke the build.
commit 79a29a8cd65534884934c60ae2fb2854e064722b
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 18:07:09 2010 +0200
s4:cldap_server/netlogon.c - handle the domain SID correctly
commit eceffe690912b1fbce4ecddaffd29b52e2cf9cd1
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 16:56:36 2010 +0200
nbt: samlogon/netlogon structures - unify denominations
commit 3f1bd92306b2f11b5c8086ef9e0a311d9e99da89
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 16:32:46 2010 +0200
s4:fill_netlogon_samlogon_response - reorder assign operations (to be consistent)
commit a89ba9e21d53ae2c163e6cdaf4198d3148d5019e
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 16:31:07 2010 +0200
s4:fill_netlogon_samlogon_response - use "lp_workgroup" for the short netbios domainname
This call is only for the DC mode.
commit 7efb43669838245cd240ac2c5aa443ba0d285b9c
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Tue Apr 27 15:27:40 2010 +0200
s4:torture - DsRAddressToSitenames[Ex]W testsuite - make it IPv4-only compatible
-----------------------------------------------------------------------
Summary of changes:
libcli/ndr_netlogon.c | 4 +-
libcli/netlogon.c | 6 ++--
librpc/gen_ndr/nbt.h | 6 ++--
librpc/gen_ndr/ndr_nbt.c | 18 +++++-----
librpc/idl/nbt.idl | 6 ++--
source3/libsmb/clidgram.c | 2 +-
source3/libsmb/dsgetdcname.c | 14 ++++----
source4/cldap_server/netlogon.c | 43 ++++++++++++++++---------
source4/libnet/libnet_become_dc.c | 2 +-
source4/libnet/libnet_unbecome_dc.c | 2 +-
source4/nbt_server/irpc.c | 4 +-
source4/torture/ldap/cldap.c | 12 +++---
source4/torture/rpc/netlogon.c | 60 ++++++++++++++++++++++++++++++++--
source4/web_server/wsgi.c | 16 +++------
14 files changed, 127 insertions(+), 68 deletions(-)
Changeset truncated at 500 lines:
diff --git a/libcli/ndr_netlogon.c b/libcli/ndr_netlogon.c
index 0354cfb..1c6b2bc 100644
--- a/libcli/ndr_netlogon.c
+++ b/libcli/ndr_netlogon.c
@@ -131,7 +131,7 @@ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
- NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain));
+ NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site));
@@ -177,7 +177,7 @@ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
- NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain));
+ NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site));
diff --git a/libcli/netlogon.c b/libcli/netlogon.c
index acfce61..9ad941c 100644
--- a/libcli/netlogon.c
+++ b/libcli/netlogon.c
@@ -152,7 +152,7 @@ void map_netlogon_samlogon_response(struct netlogon_samlogon_response *response)
response_5_ex.command = response->data.nt5.command;
response_5_ex.pdc_name = response->data.nt5.pdc_name;
response_5_ex.user_name = response->data.nt5.user_name;
- response_5_ex.domain = response->data.nt5.domain_name;
+ response_5_ex.domain_name = response->data.nt5.domain_name;
response_5_ex.domain_uuid = response->data.nt5.domain_uuid;
response_5_ex.forest = response->data.nt5.forest;
response_5_ex.dns_domain = response->data.nt5.dns_domain;
@@ -169,9 +169,9 @@ void map_netlogon_samlogon_response(struct netlogon_samlogon_response *response)
case NETLOGON_NT_VERSION_1:
ZERO_STRUCT(response_5_ex);
response_5_ex.command = response->data.nt4.command;
- response_5_ex.pdc_name = response->data.nt4.server;
+ response_5_ex.pdc_name = response->data.nt4.pdc_name;
response_5_ex.user_name = response->data.nt4.user_name;
- response_5_ex.domain = response->data.nt4.domain;
+ response_5_ex.domain_name = response->data.nt4.domain_name;
response_5_ex.nt_version = response->data.nt4.nt_version;
response_5_ex.lmnt_token = response->data.nt4.lmnt_token;
response_5_ex.lm20_token = response->data.nt4.lm20_token;
diff --git a/librpc/gen_ndr/nbt.h b/librpc/gen_ndr/nbt.h
index dc39a5c..49f96c2 100644
--- a/librpc/gen_ndr/nbt.h
+++ b/librpc/gen_ndr/nbt.h
@@ -473,9 +473,9 @@ struct NETLOGON_SAM_LOGON_REQUEST {
struct NETLOGON_SAM_LOGON_RESPONSE_NT40 {
enum netlogon_command command;
- const char * server;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
+ const char * pdc_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
- const char * domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
+ const char * domain_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
uint32_t nt_version;
uint16_t lmnt_token;
uint16_t lm20_token;
@@ -506,7 +506,7 @@ struct NETLOGON_SAM_LOGON_RESPONSE_EX {
const char * forest;
const char * dns_domain;
const char * pdc_dns_name;
- const char * domain;
+ const char * domain_name;
const char * pdc_name;
const char * user_name;
const char * server_site;
diff --git a/librpc/gen_ndr/ndr_nbt.c b/librpc/gen_ndr/ndr_nbt.c
index dc9e8cb..b3fcb85 100644
--- a/librpc/gen_ndr/ndr_nbt.c
+++ b/librpc/gen_ndr/ndr_nbt.c
@@ -1753,7 +1753,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_
{
uint32_t _flags_save_string = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
- NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pdc_name));
ndr->flags = _flags_save_string;
}
{
@@ -1765,7 +1765,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_
{
uint32_t _flags_save_string = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
- NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain));
+ NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->domain_name));
ndr->flags = _flags_save_string;
}
NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
@@ -1791,7 +1791,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_
{
uint32_t _flags_save_string = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
- NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pdc_name));
ndr->flags = _flags_save_string;
}
{
@@ -1803,7 +1803,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_
{
uint32_t _flags_save_string = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
- NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain));
+ NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->domain_name));
ndr->flags = _flags_save_string;
}
NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
@@ -1826,9 +1826,9 @@ _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_NT40(struct ndr_print *ndr,
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
ndr->depth++;
ndr_print_netlogon_command(ndr, "command", r->command);
- ndr_print_string(ndr, "server", r->server);
+ ndr_print_string(ndr, "pdc_name", r->pdc_name);
ndr_print_string(ndr, "user_name", r->user_name);
- ndr_print_string(ndr, "domain", r->domain);
+ ndr_print_string(ndr, "domain_name", r->domain_name);
ndr_print_netlogon_nt_version_flags(ndr, "nt_version", r->nt_version);
ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
@@ -1967,7 +1967,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pu
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
- NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain));
+ NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name));
NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site));
@@ -2006,7 +2006,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_pu
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
- NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain));
+ NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name));
NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site));
@@ -2045,7 +2045,7 @@ _PUBLIC_ void ndr_print_NETLOGON_SAM_LOGON_RESPONSE_EX(struct ndr_print *ndr, co
ndr_print_nbt_string(ndr, "forest", r->forest);
ndr_print_nbt_string(ndr, "dns_domain", r->dns_domain);
ndr_print_nbt_string(ndr, "pdc_dns_name", r->pdc_dns_name);
- ndr_print_nbt_string(ndr, "domain", r->domain);
+ ndr_print_nbt_string(ndr, "domain_name", r->domain_name);
ndr_print_nbt_string(ndr, "pdc_name", r->pdc_name);
ndr_print_nbt_string(ndr, "user_name", r->user_name);
ndr_print_nbt_string(ndr, "server_site", r->server_site);
diff --git a/librpc/idl/nbt.idl b/librpc/idl/nbt.idl
index a51132c..6d9f9b5 100644
--- a/librpc/idl/nbt.idl
+++ b/librpc/idl/nbt.idl
@@ -415,9 +415,9 @@ interface nbt
typedef [flag(NDR_NOALIGN),public] struct {
netlogon_command command;
- nstring server;
+ nstring pdc_name;
nstring user_name;
- nstring domain;
+ nstring domain_name;
netlogon_nt_version_flags nt_version;
uint16 lmnt_token;
uint16 lm20_token;
@@ -451,7 +451,7 @@ interface nbt
nbt_string forest;
nbt_string dns_domain;
nbt_string pdc_dns_name;
- nbt_string domain;
+ nbt_string domain_name;
nbt_string pdc_name;
nbt_string user_name;
nbt_string server_site;
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index f5dbd72..bce57ce 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -279,7 +279,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx,
/* do we still need this ? */
*nt_version = r.ntver;
- returned_domain = r.data.nt5_ex.domain;
+ returned_domain = r.data.nt5_ex.domain_name;
returned_dc = r.data.nt5_ex.pdc_name;
if (!strequal(returned_domain, domain_name)) {
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 1e1eac3..8c50a0a 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -196,13 +196,13 @@ static NTSTATUS store_cldap_reply(TALLOC_CTX *mem_ctx,
return ndr_map_error2ntstatus(ndr_err);
}
- if (r->domain) {
- status = dsgetdcname_cache_store(mem_ctx, r->domain, &blob);
+ if (r->domain_name) {
+ status = dsgetdcname_cache_store(mem_ctx, r->domain_name, &blob);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
if (r->client_site) {
- sitename_store(r->domain, r->client_site);
+ sitename_store(r->domain_name, r->client_site);
}
}
if (r->dns_domain) {
@@ -786,7 +786,7 @@ static NTSTATUS make_dc_info_from_cldap_reply(TALLOC_CTX *mem_ctx,
map_dc_and_domain_names(flags,
r->pdc_name,
- r->domain,
+ r->domain_name,
r->pdc_dns_name,
r->dns_domain,
&dc_flags,
@@ -1002,9 +1002,9 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
nt_version = NETLOGON_NT_VERSION_1;
logon1.nt_version = nt_version;
- logon1.server = tmp_dc_name;
- logon1.domain = talloc_strdup_upper(mem_ctx, domain_name);
- NT_STATUS_HAVE_NO_MEMORY(logon1.domain);
+ logon1.pdc_name = tmp_dc_name;
+ logon1.domain_name = talloc_strdup_upper(mem_ctx, domain_name);
+ NT_STATUS_HAVE_NO_MEMORY(logon1.domain_name);
r->data.nt4 = logon1;
r->ntver = nt_version;
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index 06c61ac..414f08a 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -280,7 +280,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
lp_netbios_name(lp_ctx)),
dns_domain);
NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name);
- flatname = lp_sam_name(lp_ctx);
+ flatname = lp_workgroup(lp_ctx);
server_site = samdb_server_site_name(sam_ctx, mem_ctx);
NT_STATUS_HAVE_NO_MEMORY(server_site);
client_site = samdb_client_site_name(sam_ctx, mem_ctx,
@@ -310,17 +310,15 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
} else {
netlogon->data.nt5_ex.command = LOGON_SAM_LOGON_USER_UNKNOWN_EX;
}
- netlogon->data.nt5_ex.server_type = server_type;
+ netlogon->data.nt5_ex.pdc_name = pdc_name;
+ netlogon->data.nt5_ex.user_name = user;
+ netlogon->data.nt5_ex.domain_name = flatname;
netlogon->data.nt5_ex.domain_uuid = domain_uuid;
netlogon->data.nt5_ex.forest = forest_domain;
netlogon->data.nt5_ex.dns_domain = dns_domain;
netlogon->data.nt5_ex.pdc_dns_name = pdc_dns_name;
- netlogon->data.nt5_ex.domain = flatname;
- netlogon->data.nt5_ex.pdc_name = lp_netbios_name(lp_ctx);
- netlogon->data.nt5_ex.user_name = user;
netlogon->data.nt5_ex.server_site = server_site;
netlogon->data.nt5_ex.client_site = client_site;
-
if (version & NETLOGON_NT_VERSION_5EX_WITH_IP) {
/* Clearly this needs to be fixed up for IPv6 */
extra_flags = NETLOGON_NT_VERSION_5EX_WITH_IP;
@@ -328,6 +326,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
netlogon->data.nt5_ex.sockaddr.pdc_ip = pdc_ip;
netlogon->data.nt5_ex.sockaddr.remaining = data_blob_talloc_zero(mem_ctx, 8);
}
+ netlogon->data.nt5_ex.server_type = server_type;
netlogon->data.nt5_ex.nt_version = NETLOGON_NT_VERSION_1|NETLOGON_NT_VERSION_5EX|extra_flags;
netlogon->data.nt5_ex.lmnt_token = 0xFFFF;
netlogon->data.nt5_ex.lm20_token = 0xFFFF;
@@ -362,9 +361,9 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
} else {
netlogon->data.nt4.command = LOGON_SAM_LOGON_USER_UNKNOWN;
}
- netlogon->data.nt4.server = pdc_name;
+ netlogon->data.nt4.pdc_name = pdc_name;
netlogon->data.nt4.user_name = user;
- netlogon->data.nt4.domain = flatname;
+ netlogon->data.nt4.domain_name = flatname;
netlogon->data.nt4.nt_version = NETLOGON_NT_VERSION_1;
netlogon->data.nt4.lmnt_token = 0xFFFF;
netlogon->data.nt4.lm20_token = 0xFFFF;
@@ -389,7 +388,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
const char *host = NULL;
const char *user = NULL;
const char *domain_guid = NULL;
- const char *domain_sid = NULL;
+ struct dom_sid *domain_sid = NULL;
int acct_control = -1;
int version = -1;
struct netlogon_samlogon_response netlogon;
@@ -421,9 +420,20 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
}
}
if (strcasecmp(t->u.equality.attr, "DomainSid") == 0) {
- domain_sid = talloc_strndup(tmp_ctx,
- (const char *)t->u.equality.value.data,
- t->u.equality.value.length);
+ enum ndr_err_code ndr_err;
+
+ domain_sid = talloc(tmp_ctx, struct dom_sid);
+ if (domain_sid == NULL) {
+ goto failed;
+ }
+ ndr_err = ndr_pull_struct_blob(&t->u.equality.value,
+ domain_sid, NULL,
+ domain_sid,
+ (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(domain_sid);
+ goto failed;
+ }
}
if (strcasecmp(t->u.equality.attr, "User") == 0) {
user = talloc_strndup(tmp_ctx,
@@ -440,7 +450,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
}
}
- if (domain_guid == NULL && domain == NULL) {
+ if ((domain == NULL) && (domain_guid == NULL) && (domain_sid == NULL)) {
domain = lp_dnsdomain(cldapd->task->lp_ctx);
}
@@ -451,10 +461,13 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
DEBUG(5,("cldap netlogon query domain=%s host=%s user=%s version=%d guid=%s\n",
domain, host, user, version, domain_guid));
- status = fill_netlogon_samlogon_response(cldapd->samctx, tmp_ctx, domain, NULL, NULL, domain_guid,
+ status = fill_netlogon_samlogon_response(cldapd->samctx, tmp_ctx,
+ domain, NULL, domain_sid,
+ domain_guid,
user, acct_control,
tsocket_address_inet_addr_string(src, tmp_ctx),
- version, cldapd->task->lp_ctx, &netlogon, false);
+ version, cldapd->task->lp_ctx,
+ &netlogon, false);
if (!NT_STATUS_IS_OK(status)) {
goto failed;
}
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 74242c0..a284b33 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -811,7 +811,7 @@ static void becomeDC_recv_cldap(struct tevent_req *req)
s->cldap.netlogon = s->cldap.io.out.netlogon.data.nt5_ex;
s->domain.dns_name = s->cldap.netlogon.dns_domain;
- s->domain.netbios_name = s->cldap.netlogon.domain;
+ s->domain.netbios_name = s->cldap.netlogon.domain_name;
s->domain.guid = s->cldap.netlogon.domain_uuid;
s->forest.dns_name = s->cldap.netlogon.forest;
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index 208854e..b584c75 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -307,7 +307,7 @@ static void unbecomeDC_recv_cldap(struct tevent_req *req)
s->cldap.netlogon = s->cldap.io.out.netlogon.data.nt5_ex;
s->domain.dns_name = s->cldap.netlogon.dns_domain;
- s->domain.netbios_name = s->cldap.netlogon.domain;
+ s->domain.netbios_name = s->cldap.netlogon.domain_name;
s->domain.guid = s->cldap.netlogon.domain_uuid;
s->source_dsa.dns_name = s->cldap.netlogon.pdc_dns_name;
diff --git a/source4/nbt_server/irpc.c b/source4/nbt_server/irpc.c
index dbaebf6..261e066 100644
--- a/source4/nbt_server/irpc.c
+++ b/source4/nbt_server/irpc.c
@@ -85,12 +85,12 @@ static void getdc_recv_netlogon_reply(struct dgram_mailslot_handler *dgmslot,
goto done;
}
- p = netlogon.data.samlogon.data.nt4.server;
+ p = netlogon.data.samlogon.data.nt4.pdc_name;
DEBUG(10, ("NTLOGON_SAM_LOGON_REPLY: server: %s, user: %s, "
"domain: %s\n", p,
netlogon.data.samlogon.data.nt4.user_name,
- netlogon.data.samlogon.data.nt4.domain));
+ netlogon.data.samlogon.data.nt4.domain_name));
if (*p == '\\') p += 1;
if (*p == '\\') p += 1;
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index 247a56e..05af0a6 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -188,7 +188,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
@@ -201,7 +201,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
@@ -220,7 +220,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
@@ -233,7 +233,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
@@ -247,7 +247,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
@@ -259,7 +259,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_STRING(search.out.netlogon.data.nt5_ex.forest, n1.data.nt5_ex.dns_domain);
CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.data.nt5_ex.domain, n1.data.nt5_ex.domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.domain_name, n1.data.nt5_ex.domain_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.pdc_name, n1.data.nt5_ex.pdc_name);
CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
CHECK_STRING(search.out.netlogon.data.nt5_ex.server_site, n1.data.nt5_ex.server_site);
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index d6bc013..ae6a757 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -2366,7 +2366,9 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
struct netr_DsRAddressToSitenamesW r;
struct netr_DsRAddress addrs[6];
struct sockaddr_in *addr;
+#ifdef HAVE_IPV6
struct sockaddr_in6 *addr6;
+#endif
struct netr_DsRAddressToSitenamesWCtr *ctr;
struct dcerpc_binding_handle *b = p->binding_handle;
uint32_t i;
@@ -2406,10 +2408,10 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
addrs[2].buffer = talloc_zero_array(tctx, uint8_t, addrs[2].size);
addr = (struct sockaddr_in *) addrs[2].buffer;
addr->sin_family = AF_INET;
- ret = inet_pton(AF_INET, "255.255.255.255",
- &((struct sockaddr_in *)addrs[2].buffer)->sin_addr);
+ ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
+#ifdef HAVE_IPV6
addrs[3].size = sizeof(struct sockaddr_in6);
addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
addr6 = (struct sockaddr_in6 *) addrs[3].buffer;
@@ -2430,6 +2432,30 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
addr6->sin6_family = AF_INET6;
ret = inet_pton(AF_INET6, "ff02::1", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
+#else
+ /* the test cases are repeated to have exactly 6. This is for
+ * compatibility with IPv4-only machines */
+ addrs[3].size = sizeof(struct sockaddr_in);
+ addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
+ addr = (struct sockaddr_in *) addrs[3].buffer;
+ addr->sin_family = AF_INET;
+ ret = inet_pton(AF_INET, "127.0.0.1", &addr->sin_addr);
+ torture_assert(tctx, ret > 0, "inet_pton failed");
+
+ addrs[4].size = sizeof(struct sockaddr_in);
+ addrs[4].buffer = talloc_zero_array(tctx, uint8_t, addrs[4].size);
+ addr = (struct sockaddr_in *) addrs[4].buffer;
+ addr->sin_family = AF_INET;
+ ret = inet_pton(AF_INET, "0.0.0.0", &addr->sin_addr);
+ torture_assert(tctx, ret > 0, "inet_pton failed");
+
+ addrs[5].size = sizeof(struct sockaddr_in);
+ addrs[5].buffer = talloc_zero_array(tctx, uint8_t, addrs[5].size);
+ addr = (struct sockaddr_in *) addrs[5].buffer;
+ addr->sin_family = AF_INET;
+ ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
--
Samba Shared Repository
More information about the samba-cvs
mailing list