diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-08-16 17:14:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:39 -0500 |
commit | b29915d6113264bdce243005d29a1af9a8b69bde (patch) | |
tree | 4eabcbaac1b16408df187f84a05da81a879dc803 /source3/libsmb/passchange.c | |
parent | 0be131725ff90e48d4f9696b80b35b740575fb2c (diff) | |
download | samba-b29915d6113264bdce243005d29a1af9a8b69bde.tar.gz samba-b29915d6113264bdce243005d29a1af9a8b69bde.tar.bz2 samba-b29915d6113264bdce243005d29a1af9a8b69bde.zip |
r17571: Change the return code of cli_session_setup from BOOL to NTSTATUS
Volker
(This used to be commit 94817a8ef53589011bc4ead4e17807a101acf5c9)
Diffstat (limited to 'source3/libsmb/passchange.c')
-rw-r--r-- | source3/libsmb/passchange.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index 0d3dcf4d75..e400819743 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -80,39 +80,38 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam /* Given things like SMB signing, restrict anonymous and the like, try an authenticated connection first */ - if (!cli_session_setup(cli, user_name, old_passwd, strlen(old_passwd)+1, old_passwd, strlen(old_passwd)+1, "")) { + result = cli_session_setup(cli, user_name, + old_passwd, strlen(old_passwd)+1, + old_passwd, strlen(old_passwd)+1, ""); - result = cli_nt_error(cli); - - if (!NT_STATUS_IS_OK(result)) { - - /* Password must change is the only valid error - * condition here from where we can proceed, the rest - * like account locked out or logon failure will lead - * to errors later anyway */ + if (!NT_STATUS_IS_OK(result)) { - if (!NT_STATUS_EQUAL(result, - NT_STATUS_PASSWORD_MUST_CHANGE)) { - slprintf(err_str, err_str_len-1, "Could not " - "connect to machine %s: %s\n", - remote_machine, cli_errstr(cli)); - cli_shutdown(cli); - return result; - } + /* Password must change is the only valid error condition here + * from where we can proceed, the rest like account locked out + * or logon failure will lead to errors later anyway */ - pass_must_change = True; + if (!NT_STATUS_EQUAL(result, + NT_STATUS_PASSWORD_MUST_CHANGE)) { + slprintf(err_str, err_str_len-1, "Could not " + "connect to machine %s: %s\n", + remote_machine, cli_errstr(cli)); + cli_shutdown(cli); + return result; } + pass_must_change = True; + /* * We should connect as the anonymous user here, in case * the server has "must change password" checked... * Thanks to <Nicholas.S.Jenkins@cdc.com> for this fix. */ - if (!cli_session_setup(cli, "", "", 0, "", 0, "")) { + result = cli_session_setup(cli, "", "", 0, "", 0, ""); + + if (!NT_STATUS_IS_OK(result)) { slprintf(err_str, err_str_len-1, "machine %s rejected the session setup. Error was : %s.\n", remote_machine, cli_errstr(cli) ); - result = cli_nt_error(cli); cli_shutdown(cli); return result; } |