diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-04-06 08:05:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:50:41 -0500 |
commit | 7d9763325cd68f8769d01e2e311aba5356d80077 (patch) | |
tree | 77e4566f6ab083519f7555045f148ca4aa82ebec /source4 | |
parent | 19680ba4df36400cc8834795434118960d5cafc4 (diff) | |
download | samba-7d9763325cd68f8769d01e2e311aba5356d80077.tar.gz samba-7d9763325cd68f8769d01e2e311aba5356d80077.tar.bz2 samba-7d9763325cd68f8769d01e2e311aba5356d80077.zip |
r66: fixed a segv when printing an error from a session setup failure. This
was caused by the cli to cli->tree conversion a while ago
(This used to be commit f88f1d33618562f8b8273ec45a79b819c9e48686)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/client/client.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index 61d52b82d9..0430689865 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2683,6 +2683,7 @@ static struct cli_state *do_connect(const char *server, const char *share) struct in_addr ip; fstring servicename; char *sharename; + NTSTATUS status; /* make a copy so we don't modify the global string 'service' */ fstrcpy(servicename, share); @@ -2745,12 +2746,14 @@ static struct cli_state *do_connect(const char *server, const char *share) } } - if (NT_STATUS_IS_ERR(cli_session_setup(c, username, password, - lp_workgroup()))) { + status = cli_session_setup(c, username, password, lp_workgroup()); + if (NT_STATUS_IS_ERR(status)) { /* if a password was not supplied then try again with a null username */ - if (password[0] || !username[0] || use_kerberos || - NT_STATUS_IS_ERR(cli_session_setup(c, "", "", lp_workgroup()))) { - d_printf("session setup failed: %s\n", cli_errstr(c->tree)); + if (password[0] || !username[0] || use_kerberos) { + status = cli_session_setup(c, "", "", lp_workgroup()); + } + if (NT_STATUS_IS_ERR(status)) { + d_printf("session setup failed: %s\n", nt_errstr(status)); cli_shutdown(c); return NULL; } |