summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-05-01 15:03:33 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-01 15:46:08 +0200
commit5604e8d614c938876b0a8cbc6f8c38262588f961 (patch)
tree59294a2f1e05de08c765da3fee70b8564d65d7de /source4
parentb97a591e2cb57d0a9cbe7d3aa6fdaa5de689a39d (diff)
downloadsamba-5604e8d614c938876b0a8cbc6f8c38262588f961.tar.gz
samba-5604e8d614c938876b0a8cbc6f8c38262588f961.tar.bz2
samba-5604e8d614c938876b0a8cbc6f8c38262588f961.zip
s4:libcli: remember operating system and lan manager strings from session setup
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/raw/libcliraw.h3
-rw-r--r--source4/libcli/smb_composite/sesssetup.c21
2 files changed, 24 insertions, 0 deletions
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h
index a9fcdab9cc..37e158a465 100644
--- a/source4/libcli/raw/libcliraw.h
+++ b/source4/libcli/raw/libcliraw.h
@@ -196,6 +196,9 @@ struct smbcli_session {
uint_t ntlmv2_auth:1;
uint_t plaintext_auth:1;
} options;
+
+ const char *os;
+ const char *lanman;
};
/*
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 83d15e98eb..e1159a4cd2 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -87,6 +87,8 @@ static void request_handler(struct smbcli_request *req)
DATA_BLOB null_data_blob = data_blob(NULL, 0);
NTSTATUS session_key_err, nt_status;
struct smbcli_request *check_req = NULL;
+ const char *os = NULL;
+ const char *lanman = NULL;
if (req->sign_caller_checks) {
req->do_not_free = true;
@@ -126,6 +128,8 @@ static void request_handler(struct smbcli_request *req)
}
}
}
+ os = state->setup.old.out.os;
+ lanman = state->setup.old.out.lanman;
break;
case RAW_SESSSETUP_NT1:
@@ -145,6 +149,8 @@ static void request_handler(struct smbcli_request *req)
}
}
}
+ os = state->setup.nt1.out.os;
+ lanman = state->setup.nt1.out.lanman;
break;
case RAW_SESSSETUP_SPNEGO:
@@ -216,6 +222,8 @@ static void request_handler(struct smbcli_request *req)
composite_continue_smb(c, state->req, request_handler, c);
return;
}
+ os = state->setup.spnego.out.os;
+ lanman = state->setup.spnego.out.lanman;
break;
case RAW_SESSSETUP_SMB2:
@@ -246,6 +254,19 @@ static void request_handler(struct smbcli_request *req)
return;
}
+ if (os) {
+ session->os = talloc_strdup(session, os);
+ if (composite_nomem(session->os, c)) return;
+ } else {
+ session->os = NULL;
+ }
+ if (lanman) {
+ session->lanman = talloc_strdup(session, lanman);
+ if (composite_nomem(session->lanman, c)) return;
+ } else {
+ session->lanman = NULL;
+ }
+
composite_done(c);
}