summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-31 18:59:41 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-01 15:23:32 +0100
commit7a02a2ba80c2997947a2b2c48c33f8c7647f7471 (patch)
tree42eaa448959cb015fd6525a22324b87e9711b083 /source4
parente37dc56e971f44c00791529a39144d1a972e3ca2 (diff)
downloadsamba-7a02a2ba80c2997947a2b2c48c33f8c7647f7471.tar.gz
samba-7a02a2ba80c2997947a2b2c48c33f8c7647f7471.tar.bz2
samba-7a02a2ba80c2997947a2b2c48c33f8c7647f7471.zip
s4:wrepl_server: truncate the scope of a netbios name to 237 bytes as Windows 2008 does
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/wrepl_server/wrepl_apply_records.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/wrepl_server/wrepl_apply_records.c b/source4/wrepl_server/wrepl_apply_records.c
index e6ff9a03bf..878f689f70 100644
--- a/source4/wrepl_server/wrepl_apply_records.c
+++ b/source4/wrepl_server/wrepl_apply_records.c
@@ -1358,6 +1358,20 @@ static NTSTATUS wreplsrv_apply_one_record(struct wreplsrv_partner *partner,
bool replica_vs_replica = false;
bool local_vs_replica = false;
+ if (replica->name.scope) {
+ TALLOC_CTX *parent;
+ const char *scope;
+
+ /*
+ * Windows 2008 truncates the scope to 237 bytes,
+ * so we do...
+ */
+ parent = talloc_parent(replica->name.scope);
+ scope = talloc_strndup(parent, replica->name.scope, 237);
+ NT_STATUS_HAVE_NO_MEMORY(scope);
+ replica->name.scope = scope;
+ }
+
status = winsdb_lookup(partner->service->wins_db,
&replica->name, mem_ctx, &rec);
if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_NOT_FOUND, status)) {