summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-13 21:12:44 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-15 12:12:26 +0200
commit18bec89b90a3f11d7020f170a54a4ecc0cc2187c (patch)
treec26963145ceddf6bc62e3b146b330f69db3a4af3
parentdcf54977d705c2e0c06741a2c3618f663d3a0fcd (diff)
downloadsamba-18bec89b90a3f11d7020f170a54a4ecc0cc2187c.tar.gz
samba-18bec89b90a3f11d7020f170a54a4ecc0cc2187c.tar.bz2
samba-18bec89b90a3f11d7020f170a54a4ecc0cc2187c.zip
s3:libsmb: restructure cli_negprot_done() secblob handling a bit
metze
-rw-r--r--source3/libsmb/cliconnect.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 545a02bef6..5449fcf312 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2679,7 +2679,6 @@ static void cli_negprot_done(struct tevent_req *subreq)
/* this time arrives in real GMT */
ts = interpret_long_date(((char *)(vwv+11))+1);
cli->servertime = ts.tv_sec;
- cli->secblob = data_blob(bytes, num_bytes);
server_capabilities = IVAL(vwv + 9, 1);
if (server_capabilities & CAP_RAW_MODE) {
server_readbraw = true;
@@ -2688,15 +2687,19 @@ static void cli_negprot_done(struct tevent_req *subreq)
if (server_capabilities & CAP_LOCK_AND_READ) {
server_lockread = true;
}
- /* work out if they sent us a workgroup */
- if (!(server_capabilities & CAP_EXTENDED_SECURITY) &&
- smb_buflen(inbuf) > 8) {
- ssize_t ret;
- status = smb_bytes_talloc_string(
- cli, (char *)inbuf, &cli->server_domain,
- bytes + 8, num_bytes - 8, &ret);
- if (tevent_req_nterror(req, status)) {
- return;
+ if (server_capabilities & CAP_EXTENDED_SECURITY) {
+ cli->secblob = data_blob(bytes, num_bytes);
+ } else {
+ cli->secblob = data_blob(bytes, num_bytes);
+ /* work out if they sent us a workgroup */
+ if (num_bytes > 8) {
+ ssize_t ret;
+ status = smb_bytes_talloc_string(
+ cli, (char *)inbuf, &cli->server_domain,
+ bytes + 8, num_bytes - 8, &ret);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
}
}