diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-01-15 23:19:07 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2004-01-15 23:19:07 +0000 |
commit | ff4a1461684bcf57da70067e4d40b0c5e183eed7 (patch) | |
tree | 2d9800007832dca5553250473f3b751f9bb6572f /source4/libcli | |
parent | e0469838c8dc55f17f7f5eb3b584ee1f382db5d4 (diff) | |
download | samba-ff4a1461684bcf57da70067e4d40b0c5e183eed7.tar.gz samba-ff4a1461684bcf57da70067e4d40b0c5e183eed7.tar.bz2 samba-ff4a1461684bcf57da70067e4d40b0c5e183eed7.zip |
* fixed a segv when -U is not used in smbtorture.
* fixed the handling of anonymous logins
(This used to be commit 7cbc4ad8710ad33387145bfc9974d0ed4b0fb231)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/raw/clisession.c | 12 | ||||
-rw-r--r-- | source4/libcli/raw/clitree.c | 12 |
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) { |