mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
Finally worked out why a enumerate trusted domains was returning a
NT_STATUS_UNABLE_TO_FREE_VM error. This error code was mis-defined
as 0x8000001a instead of 0xc000001a. The former is actually a
NT_STATUS_NO_MORE_ENTRIES warning which is what we see in the status
code.
Removed the & 0xffffff from the loop in get_nt_error_msg() as all the
error constants now have the correct high bits set.
(This used to be commit 80dca2c9e4
)
This commit is contained in:
@ -28,6 +28,8 @@
|
||||
/* Win32 Status codes. */
|
||||
|
||||
#define STATUS_BUFFER_OVERFLOW NT_STATUS(0x80000005)
|
||||
#define NT_STATUS_NO_MORE_ENTRIES NT_STATUS(0x8000001a)
|
||||
|
||||
#define STATUS_MORE_ENTRIES NT_STATUS(0x0105)
|
||||
#define ERROR_INVALID_PARAMETER NT_STATUS(0x0057)
|
||||
#define ERROR_INSUFFICIENT_BUFFER NT_STATUS(0x007a)
|
||||
@ -37,6 +39,23 @@
|
||||
/* Win32 Error codes extracted using a loop in smbclient then printing a
|
||||
netmon sniff to a file. */
|
||||
|
||||
/*
|
||||
--------------
|
||||
/ \
|
||||
/ REST \
|
||||
/ IN \
|
||||
/ PEACE \
|
||||
/ \
|
||||
| NT_STATUS_NOPROBLEMO |
|
||||
| |
|
||||
| |
|
||||
| 4 September |
|
||||
| |
|
||||
| 2001 |
|
||||
*| * * * | *
|
||||
_________)/\\_//(\/(/\)/\//\/\///|_)_______
|
||||
*/
|
||||
|
||||
#define NT_STATUS_OK NT_STATUS(0x0000)
|
||||
#define NT_STATUS_UNSUCCESSFUL NT_STATUS(0xC0000000 | 0x0001)
|
||||
#define NT_STATUS_NOT_IMPLEMENTED NT_STATUS(0xC0000000 | 0x0002)
|
||||
@ -63,7 +82,7 @@
|
||||
#define NT_STATUS_NO_MEMORY NT_STATUS(0xC0000000 | 0x0017)
|
||||
#define NT_STATUS_CONFLICTING_ADDRESSES NT_STATUS(0xC0000000 | 0x0018)
|
||||
#define NT_STATUS_NOT_MAPPED_VIEW NT_STATUS(0xC0000000 | 0x0019)
|
||||
#define NT_STATUS_UNABLE_TO_FREE_VM NT_STATUS(0x80000000 | 0x001a)
|
||||
#define NT_STATUS_UNABLE_TO_FREE_VM NT_STATUS(0xC0000000 | 0x001a)
|
||||
#define NT_STATUS_UNABLE_TO_DELETE_SECTION NT_STATUS(0xC0000000 | 0x001b)
|
||||
#define NT_STATUS_INVALID_SYSTEM_SERVICE NT_STATUS(0xC0000000 | 0x001c)
|
||||
#define NT_STATUS_ILLEGAL_INSTRUCTION NT_STATUS(0xC0000000 | 0x001d)
|
||||
|
@ -25,7 +25,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
/** @defgroup rpc_client RPC Client
|
||||
/** @defgroup lsa LSA rpc client routines
|
||||
* @ingroup rpc_client
|
||||
*
|
||||
* @{
|
||||
**/
|
||||
@ -37,16 +38,22 @@
|
||||
* security authority", which is half of a password database.
|
||||
**/
|
||||
|
||||
/** Opens a SMB connection to the lsa pipe
|
||||
/** Opens a SMB connection and connects to the LSARPC pipe.
|
||||
*
|
||||
* @param system_name NETBIOS name of the machine to connect to. */
|
||||
* @param cli Uninitialised client handle.
|
||||
* @param system_name NETBIOS name of the machine to connect to.
|
||||
* @param creds User credentials to connect as.
|
||||
* @returns Initialised client handle.
|
||||
*/
|
||||
struct cli_state *cli_lsa_initialise(struct cli_state *cli, char *system_name,
|
||||
struct ntuser_creds *creds)
|
||||
{
|
||||
return cli_pipe_initialise(cli, system_name, PIPE_LSARPC, creds);
|
||||
}
|
||||
|
||||
/** Open a LSA policy handle */
|
||||
/** Open a LSA policy handle
|
||||
*
|
||||
* @param cli Handle on an initialised SMB connection */
|
||||
|
||||
NTSTATUS cli_lsa_open_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
BOOL sec_qos, uint32 des_access, POLICY_HND *pol)
|
||||
@ -548,12 +555,8 @@ NTSTATUS cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
|
||||
result = r.status;
|
||||
|
||||
/* For some undocumented reason this function sometimes returns
|
||||
0x8000001a (NT_STATUS_UNABLE_TO_FREE_VM) so we ignore it and
|
||||
pretend everything is OK. */
|
||||
|
||||
if (!NT_STATUS_IS_OK(result) &&
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_UNABLE_TO_FREE_VM)) {
|
||||
NT_STATUS_V(result) != NT_STATUS_V(NT_STATUS_NO_MORE_ENTRIES)) {
|
||||
|
||||
/* An actual error ocured */
|
||||
|
||||
|
@ -534,6 +534,7 @@ nt_err_code_struct nt_errs[] =
|
||||
{ "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS },
|
||||
{ "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT },
|
||||
{ "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE },
|
||||
{ "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES },
|
||||
{ NULL, NT_STATUS(0) }
|
||||
};
|
||||
|
||||
@ -548,8 +549,8 @@ char *get_nt_error_msg(NTSTATUS nt_code)
|
||||
slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
|
||||
|
||||
while (nt_errs[idx].nt_errstr != NULL) {
|
||||
if ((NT_STATUS_V(nt_errs[idx].nt_errcode) & 0xFFFFFF) ==
|
||||
(NT_STATUS_V(nt_code) & 0xFFFFFF)) {
|
||||
if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
|
||||
NT_STATUS_V(nt_code)) {
|
||||
return nt_errs[idx].nt_errstr;
|
||||
}
|
||||
idx++;
|
||||
|
Reference in New Issue
Block a user