summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-02-04 14:25:52 +0100
committerStefan Metzmacher <metze@samba.org>2011-05-18 10:50:57 +0200
commit6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7 (patch)
treee0e7e81cc4ec72d55ca02f41c76de9d7b122c687 /source3
parent310502a15ac03e642d0015e050e8407351f6dcd9 (diff)
downloadsamba-6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7.tar.gz
samba-6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7.tar.bz2
samba-6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7.zip
s3-libsmb/passchange.c: Fix cli_errstr() usage (part of bug #7864)
Convert cli_errstr() to nt_errstr() Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/passchange.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index fc68e41bd9..37496bdb13 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 {