From: Björn Baumbach Date: Fri, 4 Feb 2011 13:25:52 +0000 (+0100) Subject: s3-libsmb/passchange.c: Fix cli_errstr() usage (part of bug #7864) X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7;p=metze%2Fsamba%2Fwip.git s3-libsmb/passchange.c: Fix cli_errstr() usage (part of bug #7864) Convert cli_errstr() to nt_errstr() Signed-off-by: Stefan Metzmacher --- diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index fc68e41bd91b..37496bdb1331 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -85,12 +85,12 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam make_nmb_name(&called , remote_machine, 0x20); if (!cli_session_request(cli, &calling, &called)) { + result = cli_nt_error(cli); if (asprintf(err_str, "machine %s rejected the session setup. " "Error was : %s.\n", - remote_machine, cli_errstr(cli)) == -1) { + remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } - result = cli_nt_error(cli); cli_shutdown(cli); return result; } @@ -126,7 +126,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam if (!NT_STATUS_EQUAL(result, NT_STATUS_PASSWORD_MUST_CHANGE) && !NT_STATUS_EQUAL(result, NT_STATUS_PASSWORD_EXPIRED)) { if (asprintf(err_str, "Could not connect to machine %s: " - "%s\n", remote_machine, cli_errstr(cli)) == -1) { + "%s\n", remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } cli_shutdown(cli); @@ -146,7 +146,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam if (!NT_STATUS_IS_OK(result)) { if (asprintf(err_str, "machine %s rejected the session " "setup. Error was : %s.\n", - remote_machine, cli_errstr(cli)) == -1) { + remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } cli_shutdown(cli); @@ -204,12 +204,12 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam if (lp_client_lanman_auth()) { /* Use the old RAP method. */ if (!cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) { + result = cli_nt_error(cli); if (asprintf(err_str, "machine %s rejected the " "password change: Error was : %s.\n", - remote_machine, cli_errstr(cli)) == -1) { + remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } - result = cli_nt_error(cli); cli_shutdown(cli); return result; } @@ -295,12 +295,13 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam cli_shutdown(cli); return NT_STATUS_OK; } + + result = cli_nt_error(cli); if (asprintf(err_str, "machine %s rejected the password " "change: Error was : %s.\n", - remote_machine, cli_errstr(cli)) == -1) { + remote_machine, nt_errstr(result)) == -1) { *err_str = NULL; } - result = cli_nt_error(cli); cli_shutdown(cli); return result; } else {