summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-07-03 11:21:50 +0200
committerVolker Lendecke <vl@samba.org>2011-07-03 11:31:29 +0200
commitc3a6e9b7cea4f48bcb5a9de1fad26e3da3b53f7c (patch)
tree40f62cf430a9fd63c94fedb7ca47616af47b98d3 /source3/libsmb
parentc0d168392fc41ab8c04c40f25760d5cf5f71ed3f (diff)
downloadsamba-c3a6e9b7cea4f48bcb5a9de1fad26e3da3b53f7c.tar.gz
samba-c3a6e9b7cea4f48bcb5a9de1fad26e3da3b53f7c.tar.bz2
samba-c3a6e9b7cea4f48bcb5a9de1fad26e3da3b53f7c.zip
s3: RAP errors are WERROR
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clierror.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 7974e7769b..32de7ecd44 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -22,35 +22,6 @@
#include "includes.h"
#include "libsmb/libsmb.h"
-/*****************************************************
- RAP error codes - a small start but will be extended.
-
- XXX: Perhaps these should move into a common function because they're
- duplicated in clirap2.c
-
-*******************************************************/
-
-static const struct {
- int err;
- const char *message;
-} rap_errmap[] = {
- {5, "RAP5: User has insufficient privilege" },
- {50, "RAP50: Not supported by server" },
- {65, "RAP65: Access denied" },
- {86, "RAP86: The specified password is invalid" },
- {2220, "RAP2220: Group does not exist" },
- {2221, "RAP2221: User does not exist" },
- {2226, "RAP2226: Operation only permitted on a Primary Domain Controller" },
- {2237, "RAP2237: User is not in group" },
- {2242, "RAP2242: The password of this user has expired." },
- {2243, "RAP2243: The password of this user cannot change." },
- {2244, "RAP2244: This password cannot be used now (password history conflict)." },
- {2245, "RAP2245: The password is shorter than required." },
- {2246, "RAP2246: The password of this user is too recent to change."},
-
- {0, NULL}
-};
-
/****************************************************************************
Return a description of an SMB error.
****************************************************************************/
@@ -98,7 +69,6 @@ const char *cli_errstr(struct cli_state *cli)
fstring cli_error_message;
uint32 flgs2 = SVAL(cli->inbuf,smb_flg2), errnum;
uint8 errclass;
- int i;
char *result;
if (!cli->initialised) {
@@ -144,15 +114,8 @@ const char *cli_errstr(struct cli_state *cli)
/* Case #1: RAP error */
if (cli->rap_error) {
- for (i = 0; rap_errmap[i].message != NULL; i++) {
- if (rap_errmap[i].err == cli->rap_error) {
- return rap_errmap[i].message;
- }
- }
-
- slprintf(cli_error_message, sizeof(cli_error_message) - 1, "RAP code %d",
- cli->rap_error);
-
+ strlcpy(cli_error_message, win_errstr(W_ERROR(cli->rap_error)),
+ sizeof(cli_error_message));
goto done;
}