summaryrefslogtreecommitdiff
path: root/source4/libcli/finddcs.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-12 06:44:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:50:55 -0500
commit3f8ee534bafa149c00f050abea8ae111fea61287 (patch)
treee6590a52b5a8549671217a2d48be301aa82464dd /source4/libcli/finddcs.c
parent4b2ed199ca12cedab42683e628eb7e8da6eb0fb4 (diff)
downloadsamba-3f8ee534bafa149c00f050abea8ae111fea61287.tar.gz
samba-3f8ee534bafa149c00f050abea8ae111fea61287.tar.bz2
samba-3f8ee534bafa149c00f050abea8ae111fea61287.zip
r12862: Need to trim spaces off the end of the node status reply.
Andrew Bartlett (This used to be commit 3e90e7edfa7d343a6b6bf073b8f4d018e3b463d0)
Diffstat (limited to 'source4/libcli/finddcs.c')
-rw-r--r--source4/libcli/finddcs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index 036b937f69..3b72cceba0 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -214,7 +214,16 @@ static void fallback_node_status_replied(struct nbt_name_request *name_req)
if (!composite_is_ok(state->ctx)) return;
if (state->node_status.out.status.num_names > 0) {
- state->dcs[0].name = talloc_steal(state->dcs, state->node_status.out.status.names[0].name);
+ int i;
+ char *name = talloc_strndup(state->dcs, state->node_status.out.status.names[0].name, 15);
+ /* Strip space padding */
+ if (name) {
+ i = MIN(strlen(name), 15);
+ for (; i > 0 && name[i - 1] == ' '; i--) {
+ name[i - 1] = '\0';
+ }
+ }
+ state->dcs[0].name = name;
composite_done(state->ctx);
return;
}