1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Björn Baumbach 2011-02-04 14:25:52 +01:00 committed by Stefan Metzmacher
parent 310502a15a
commit 6552ed64c1

View File

@ -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 {