summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-22 05:36:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:06 -0500
commit3b9431ddb963db68101e35b54f044ba0938b2fa7 (patch)
treeef564173e1b4d5f0cce2f412cbe977e8b4cfc3c5 /source4/libcli
parentaefaa18554a55da5b5d9fdb9815eb246b539c8a2 (diff)
downloadsamba-3b9431ddb963db68101e35b54f044ba0938b2fa7.tar.gz
samba-3b9431ddb963db68101e35b54f044ba0938b2fa7.tar.bz2
samba-3b9431ddb963db68101e35b54f044ba0938b2fa7.zip
r4927: parse the NBT session request in the smb server. This gets rid of that
annoying "not parsing session request" message on each SMB connection (This used to be commit b06b8dd2f4f4fea750b05fd29d68372828159f16)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/nbt/nbtname.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index 8c46379f0b..0584f55fb1 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -63,7 +63,7 @@ static NTSTATUS ndr_pull_component(struct ndr_pull *ndr, uint8_t **component,
/* its a reserved length field */
return NT_STATUS_BAD_NETWORK_NAME;
}
- if (*offset + len + 2 >= ndr->data_size) {
+ if (*offset + len + 2 > ndr->data_size) {
return NT_STATUS_BAD_NETWORK_NAME;
}
*component = (uint8_t*)talloc_strndup(ndr, &ndr->data[1 + *offset], len);
@@ -309,6 +309,17 @@ NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct nbt_name
(ndr_push_flags_fn_t)ndr_push_nbt_name);
}
+
+/*
+ pull a nbt name from a blob
+*/
+NTSTATUS nbt_name_from_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, struct nbt_name *name)
+{
+ return ndr_pull_struct_blob(blob, mem_ctx, name,
+ (ndr_pull_flags_fn_t)ndr_pull_nbt_name);
+}
+
+
/*
choose a name to use when calling a server in a NBT session request.
we use heuristics to see if the name we have been given is a IP