summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/raw/clisession.c12
-rw-r--r--source4/libcli/raw/clitree.c12
2 files changed, 18 insertions, 6 deletions
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 9d154e10cd..c5d4888089 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -272,7 +272,10 @@ static NTSTATUS smb_raw_session_setup_generic_old(struct cli_session *session,
s2.old.in.os = "Unix";
s2.old.in.lanman = "Samba";
- if (session->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
+ if (!parms->generic.in.password) {
+ s2.old.in.password = data_blob(NULL, 0);
+ } else if (session->transport->negotiate.sec_mode &
+ NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
s2.old.in.password = lanman_blob(parms->generic.in.password,
session->transport->negotiate.secblob);
} else {
@@ -318,8 +321,11 @@ static NTSTATUS smb_raw_session_setup_generic_nt1(struct cli_session *session,
s2.nt1.in.os = "Unix";
s2.nt1.in.lanman = "Samba";
- if (s2.nt1.in.user[0] &&
- (session->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE)) {
+ if (!parms->generic.in.password) {
+ s2.nt1.in.password1 = data_blob(NULL, 0);
+ s2.nt1.in.password2 = data_blob(NULL, 0);
+ } else if (session->transport->negotiate.sec_mode &
+ NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
s2.nt1.in.password1 = lanman_blob(parms->generic.in.password,
session->transport->negotiate.secblob);
s2.nt1.in.password2 = nt_blob(parms->generic.in.password,
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c
index 1114c8a9c5..b35bf67c94 100644
--- a/source4/libcli/raw/clitree.c
+++ b/source4/libcli/raw/clitree.c
@@ -238,9 +238,15 @@ NTSTATUS cli_tree_full_connection(struct cli_tree **ret_tree,
setup.generic.in.capabilities = CAP_UNICODE | CAP_STATUS32 |
CAP_LARGE_FILES | CAP_NT_SMBS | CAP_LEVEL_II_OPLOCKS |
CAP_W2K_SMBS | CAP_LARGE_READX | CAP_LARGE_WRITEX;
- setup.generic.in.password = password;
- setup.generic.in.user = user;
- setup.generic.in.domain = domain;
+ if (!user || !user[0]) {
+ setup.generic.in.password = NULL;
+ setup.generic.in.user = "";
+ setup.generic.in.domain = "";
+ } else {
+ setup.generic.in.password = password;
+ setup.generic.in.user = user;
+ setup.generic.in.domain = domain;
+ }
mem_ctx = talloc_init("tcon");
if (!mem_ctx) {