diff options
author | Günther Deschner <gd@samba.org> | 2007-12-21 15:30:29 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2007-12-21 15:30:29 +0100 |
commit | d230cd8dd554439c7d5e8fa9d7fd56520d9288d0 (patch) | |
tree | f1055c1b6ca9ae06755725c1cb93a44d06a18c76 /source3 | |
parent | 9518d738b17eb987dffb20f68df6b6768113b441 (diff) | |
download | samba-d230cd8dd554439c7d5e8fa9d7fd56520d9288d0.tar.gz samba-d230cd8dd554439c7d5e8fa9d7fd56520d9288d0.tar.bz2 samba-d230cd8dd554439c7d5e8fa9d7fd56520d9288d0.zip |
Make libnetapi_errstr use our NTSTATUS and WERROR error string macros.
Guenther
(This used to be commit e46aa35d432e930835206b9ce7583f46933015d8)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/netapi/netapi.c | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index 1db745b5c7..032798d0f9 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -152,52 +152,9 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, const char *libnetapi_errstr(struct libnetapi_ctx *ctx, NET_API_STATUS status) { - const char *err_str = NULL; - - switch (status) { - case 0: - err_str = "Success"; - break; - case 0x00000005: /* WERR_ACCESS_DENIED */ - err_str = "Access is denied"; - break; - case 0x00000057: /* WERR_INVALID_PARAM */ - err_str = "Invalid parameter"; - break; - case 0x0000052E: /* WERR_LOGON_FAILURE */ - err_str = "Invalid logon credentials"; - break; - case 0x00000995: /* WERR_DOMAIN_CONTROLLER_NOT_FOUND */ - err_str = "A domain controller could not be found"; - break; - case 0x00000a84: /* WERR_SETUP_NOT_JOINED */ - err_str = "Join failed"; - break; - case 0x00000a83: /* WERR_SETUP_ALREADY_JOINED */ - err_str = "Machine is already joined"; - break; - case 0x00000a85: /* WERR_SETUP_DOMAIN_CONTROLLER */ - err_str = "Machine is a Domain Controller"; - break; - case 0x00000032: /* WERR_NOT_SUPPORTED */ - err_str = "Not supported"; - break; - case 0x0000051f: /* WERR_NO_LOGON_SERVERS */ - err_str = "No logon servers found"; - break; - case 0x00000056: /* WERR_BAD_PASSWORD */ - err_str = "A bad password was supplied"; - break; - case 0x00000520: /* WERR_NO_SUCH_LOGON_SESSION */ - err_str = "No such logon session"; - break; - default: - err_str = talloc_asprintf(ctx, "0x%08x", status); - if (!err_str) { - return NULL; - } - break; + if (status & 0xc0000000) { + return get_friendly_nt_error_msg(NT_STATUS(status)); } - return err_str; + return get_friendly_werror_msg(W_ERROR(status)); } |