From: Björn Baumbach Date: Mon, 17 Jan 2011 11:02:39 +0000 (+0100) Subject: s3-smbclient: Fix cli_errstr() usage (part of bug #7864) X-Git-Tag: tevent-0.9.11~1259 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09c612f377749b79b850ee6c52ae49699e256359;p=thirdparty%2Fsamba.git s3-smbclient: Fix cli_errstr() usage (part of bug #7864) Convert cli_errstr() to nt_errstr() Signed-off-by: Stefan Metzmacher --- diff --git a/source3/client/client.c b/source3/client/client.c index 33c1a24fcc0..cd9150d2772 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4110,6 +4110,7 @@ static int cmd_logon(void) { TALLOC_CTX *ctx = talloc_tos(); char *l_username, *l_password; + NTSTATUS nt_status; if (!next_token_talloc(ctx, &cmd_ptr,&l_username,NULL)) { d_printf("logon []\n"); @@ -4126,11 +4127,12 @@ static int cmd_logon(void) return 1; } - if (!NT_STATUS_IS_OK(cli_session_setup(cli, l_username, - l_password, strlen(l_password), - l_password, strlen(l_password), - lp_workgroup()))) { - d_printf("session setup failed: %s\n", cli_errstr(cli)); + nt_status = cli_session_setup(cli, l_username, + l_password, strlen(l_password), + l_password, strlen(l_password), + lp_workgroup()); + if (!NT_STATUS_IS_OK(nt_status)) { + d_printf("session setup failed: %s\n", nt_errstr(nt_status)); return -1; }