summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-05 18:22:57 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 08:33:40 +0200
commit817bb1f8f24bb86bcf675a9294169d5320512178 (patch)
treec798de7f82b3de52c1b3ab5d5c2b4e53ca04ccfd
parent884a5a620f06c76c8b800fa5ddfbaf8dce240563 (diff)
downloadsamba-817bb1f8f24bb86bcf675a9294169d5320512178.tar.gz
samba-817bb1f8f24bb86bcf675a9294169d5320512178.tar.bz2
samba-817bb1f8f24bb86bcf675a9294169d5320512178.zip
s3:smb2cli: don't terminate the pathname in smb2cli_tcon()
Windows generates NT_STATUS_BAD_NETWORK_NAME otherwise. metze
-rw-r--r--source3/libsmb/smb2cli_tcon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_tcon.c b/source3/libsmb/smb2cli_tcon.c
index c51418227d..8c2c802bdd 100644
--- a/source3/libsmb/smb2cli_tcon.c
+++ b/source3/libsmb/smb2cli_tcon.c
@@ -60,12 +60,17 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
if (!convert_string_talloc(state, CH_UNIX, CH_UTF16,
- tcon_share, talloc_get_size(tcon_share),
+ tcon_share, strlen(tcon_share),
&dyn, &dyn_len)) {
tevent_req_oom(req);
return tevent_req_post(req, ev);
}
+ if (strlen(tcon_share) == 0) {
+ TALLOC_FREE(dyn);
+ dyn_len = 0;
+ }
+
fixed = state->fixed;
SSVAL(fixed, 0, 9);
SSVAL(fixed, 4, SMB2_HDR_BODY + 8);