]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Remove unused cli_errstr()
authorVolker Lendecke <vl@samba.org>
Sat, 16 May 2020 15:01:04 +0000 (17:01 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 25 May 2020 08:13:28 +0000 (08:13 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/clierror.c
source3/libsmb/proto.h

index 66dfea0654f9a5f852b839dd5f12e76568fe652d..b92b31601740a997a5cbac634fcd248fd7ad9b96 100644 (file)
 #include "libsmb/libsmb.h"
 #include "../libcli/smb/smbXcli_base.h"
 
-/***************************************************************************
- Return an error message - either an NT error, SMB error or a RAP error.
- Note some of the NT errors are actually warnings or "informational" errors
- in which case they can be safely ignored.
-****************************************************************************/
-
-const char *cli_errstr(struct cli_state *cli)
-{   
-       fstring cli_error_message;
-       char *result;
-
-       if (!cli->initialised) {
-               fstrcpy(cli_error_message, "[Programmer's error] cli_errstr called on uninitialized cli_stat struct!\n");
-               goto done;
-       }
-
-       /* Case #1: RAP error */
-       if (cli->rap_error) {
-               strlcpy(cli_error_message, win_errstr(W_ERROR(cli->rap_error)),
-                       sizeof(cli_error_message));
-               goto done;
-       }
-
-       if (!cli_state_is_connected(cli) && NT_STATUS_IS_OK(cli->raw_status)) {
-               return nt_errstr(NT_STATUS_CONNECTION_DISCONNECTED);
-       }
-
-       return nt_errstr(cli->raw_status);
- done:
-       result = talloc_strdup(talloc_tos(), cli_error_message);
-       SMB_ASSERT(result);
-       return result;
-}
-
-
 /****************************************************************************
  Return the 32-bit NT status code from the last packet.
 ****************************************************************************/
index b9764a4aae2096342c8a20e5ccae5106fd232294..1ffc411c133b4be008e13e19cf8edcdd1a1e6d90 100644 (file)
@@ -224,7 +224,6 @@ NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 
 /* The following definitions come from libsmb/clierror.c  */
 
-const char *cli_errstr(struct cli_state *cli);
 NTSTATUS cli_nt_error(struct cli_state *cli);
 void cli_dos_error(struct cli_state *cli, uint8_t *eclass, uint32_t *ecode);
 int cli_errno(struct cli_state *cli);