summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-09-04 01:03:53 +0400
committerMatthieu Patou <mat@matws.net>2010-10-05 11:19:40 +0400
commit8a0095b930f7ad2a4451f56f204fb0bd73bce66b (patch)
tree1aba4fb3fdefd5a4e4c9f9b16077cb16133470c8 /source4/smb_server/smb
parent52d32e08a4227909662a50a989633e9acd4bbb2f (diff)
downloadsamba-8a0095b930f7ad2a4451f56f204fb0bd73bce66b.tar.gz
samba-8a0095b930f7ad2a4451f56f204fb0bd73bce66b.tar.bz2
samba-8a0095b930f7ad2a4451f56f204fb0bd73bce66b.zip
dfs: Fix wrong size of referral, change order of dc referral
Order of referral is now like w2k8/w2k8r2 as it seems it has an influence on how clients manage to get it.
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r--source4/smb_server/smb/trans2.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c
index 38381fd2c1..aae85d6be9 100644
--- a/source4/smb_server/smb/trans2.c
+++ b/source4/smb_server/smb/trans2.c
@@ -873,7 +873,8 @@ static NTSTATUS fill_normal_dfs_referraltype(struct dfs_referral_type *ref,
ZERO_STRUCTP(ref);
ref->version = version;
ref->referral.v3.data.server_type = DFS_SERVER_NON_ROOT;
- ref->referral.v3.size = 18;
+ /* "normal" referral seems to always include the GUID */
+ ref->referral.v3.size = 34;
ref->referral.v3.data.entry_flags = 0;
ref->referral.v3.data.ttl = 600; /* As w2k3 */
@@ -885,7 +886,8 @@ static NTSTATUS fill_normal_dfs_referraltype(struct dfs_referral_type *ref,
ZERO_STRUCTP(ref);
ref->version = version;
ref->referral.v4.server_type = DFS_SERVER_NON_ROOT;
- ref->referral.v4.size = 18;
+ /* "normal" referral seems to always include the GUID */
+ ref->referral.v4.size = 34;
if (isfirstoffset) {
ref->referral.v4.entry_flags = DFS_HEADER_FLAG_TARGET_BCK;
@@ -914,7 +916,12 @@ static NTSTATUS fill_domain_dfs_referraltype(struct dfs_referral_type *ref,
ZERO_STRUCTP(ref);
ref->version = version;
ref->referral.v3.data.server_type = DFS_SERVER_NON_ROOT;
- ref->referral.v3.size = 34;
+ /* It's hard coded ... don't think it's a good way but the sizeof return not the
+ * correct values
+ *
+ * We have 18 if the GUID is not included 34 otherwise
+ */
+ ref->referral.v3.size = 18;
ref->referral.v3.data.entry_flags = DFS_FLAG_REFERRAL_DOMAIN_RESP;
ref->referral.v3.data.ttl = 600; /* As w2k3 */
ref->referral.v3.data.referrals.r2.special_name = domain;
@@ -1249,7 +1256,7 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx,
referral = talloc(tab, struct dfs_referral_type);
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(referral, context);
- referral_str = talloc_asprintf(referral, "\\%s", dns_domain);
+ referral_str = talloc_asprintf(referral, "\\%s", netbios_domain);
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(referral_str, context);
status = fill_domain_dfs_referraltype(referral, 3,
referral_str,
@@ -1265,7 +1272,7 @@ static NTSTATUS dodomain_referral(TALLOC_CTX *ctx,
referral = talloc(tab, struct dfs_referral_type);
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(referral, context);
- referral_str = talloc_asprintf(referral, "\\%s", netbios_domain);
+ referral_str = talloc_asprintf(referral, "\\%s", dns_domain);
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(referral_str, context);
status = fill_domain_dfs_referraltype(referral, 3,
referral_str,