summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-02-28 17:25:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:02 -0500
commite31d922592b3bb037daff487f0b68c719e7584d4 (patch)
tree08cce2e6752d59fd76ff100714133a7e3558fbae /source4/libcli
parent7f13043d7eed4ee907bda688b5e10bef233871f5 (diff)
downloadsamba-e31d922592b3bb037daff487f0b68c719e7584d4.tar.gz
samba-e31d922592b3bb037daff487f0b68c719e7584d4.tar.bz2
samba-e31d922592b3bb037daff487f0b68c719e7584d4.zip
r21593: give a more useful error, when we can't resolve a long name
via broadcast of wins metze (This used to be commit 49591d699653e48f2e9540359e5b4ae97786511c)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/resolve/nbtlist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index 58433d0a70..e8ea22a0dc 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -126,6 +126,15 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx,
if (composite_nomem(state->name.scope, c)) return c;
}
+ /*
+ * we can't push long names on the wire,
+ * so bail out here to give a useful error message
+ */
+ if (strlen(state->name.name) > 15) {
+ composite_error(c, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+ return c;
+ }
+
state->nbtsock = nbt_name_socket_init(state, event_ctx);
if (composite_nomem(state->nbtsock, c)) return c;