1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3-netlogon: use WERRORs in NETLOGON_INFO structures.

Guenther
This commit is contained in:
Günther Deschner 2009-09-02 15:29:44 +02:00
parent 6657598168
commit a0b1968167
4 changed files with 35 additions and 75 deletions

View File

@ -5627,7 +5627,7 @@ static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_1(struct ndr_push *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
}
if (ndr_flags & NDR_BUFFERS) {
}
@ -5639,7 +5639,7 @@ static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_1(struct ndr_pull *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status));
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
}
if (ndr_flags & NDR_BUFFERS) {
}
@ -5651,7 +5651,7 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *
ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_1");
ndr->depth++;
ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status);
ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
ndr->depth--;
}
@ -5660,9 +5660,9 @@ static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_2(struct ndr_push *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_netr_InfoFlags(ndr, NDR_SCALARS, r->flags));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pdc_connection_status));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->pdc_connection_status));
NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tc_connection_status));
NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->tc_connection_status));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->trusted_dc_name) {
@ -5682,14 +5682,14 @@ static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_2(struct ndr_pull *ndr, int
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_netr_InfoFlags(ndr, NDR_SCALARS, &r->flags));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pdc_connection_status));
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->pdc_connection_status));
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_dc_name));
if (_ptr_trusted_dc_name) {
NDR_PULL_ALLOC(ndr, r->trusted_dc_name);
} else {
r->trusted_dc_name = NULL;
}
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tc_connection_status));
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->tc_connection_status));
}
if (ndr_flags & NDR_BUFFERS) {
if (r->trusted_dc_name) {
@ -5713,14 +5713,14 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *
ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_2");
ndr->depth++;
ndr_print_netr_InfoFlags(ndr, "flags", r->flags);
ndr_print_uint32(ndr, "pdc_connection_status", r->pdc_connection_status);
ndr_print_WERROR(ndr, "pdc_connection_status", r->pdc_connection_status);
ndr_print_ptr(ndr, "trusted_dc_name", r->trusted_dc_name);
ndr->depth++;
if (r->trusted_dc_name) {
ndr_print_string(ndr, "trusted_dc_name", r->trusted_dc_name);
}
ndr->depth--;
ndr_print_uint32(ndr, "tc_connection_status", r->tc_connection_status);
ndr_print_WERROR(ndr, "tc_connection_status", r->tc_connection_status);
ndr->depth--;
}

View File

@ -656,14 +656,14 @@ struct netr_AccountBuffer {
struct netr_NETLOGON_INFO_1 {
uint32_t flags;
uint32_t pdc_connection_status;
WERROR pdc_connection_status;
};
struct netr_NETLOGON_INFO_2 {
uint32_t flags;
uint32_t pdc_connection_status;
WERROR pdc_connection_status;
const char *trusted_dc_name;/* [unique,charset(UTF16)] */
uint32_t tc_connection_status;
WERROR tc_connection_status;
};
struct netr_NETLOGON_INFO_3 {

View File

@ -843,14 +843,14 @@ interface netlogon
typedef struct {
netr_InfoFlags flags;
uint32 pdc_connection_status;
WERROR pdc_connection_status;
} netr_NETLOGON_INFO_1;
typedef struct {
netr_InfoFlags flags;
uint32 pdc_connection_status;
WERROR pdc_connection_status;
[string,charset(UTF16)] uint16 *trusted_dc_name;
uint32 tc_connection_status;
WERROR tc_connection_status;
} netr_NETLOGON_INFO_2;
typedef struct {

View File

@ -38,46 +38,6 @@ struct netlogon_server_pipe_state {
struct netr_Credential server_challenge;
};
/*******************************************************************
Inits a netr_NETLOGON_INFO_1 structure.
********************************************************************/
static void init_netlogon_info1(struct netr_NETLOGON_INFO_1 *r,
uint32_t flags,
uint32_t pdc_connection_status)
{
r->flags = flags;
r->pdc_connection_status = pdc_connection_status;
}
/*******************************************************************
Inits a netr_NETLOGON_INFO_2 structure.
********************************************************************/
static void init_netlogon_info2(struct netr_NETLOGON_INFO_2 *r,
uint32_t flags,
uint32_t pdc_connection_status,
const char *trusted_dc_name,
uint32_t tc_connection_status)
{
r->flags = flags;
r->pdc_connection_status = pdc_connection_status;
r->trusted_dc_name = trusted_dc_name;
r->tc_connection_status = tc_connection_status;
}
/*******************************************************************
Inits a netr_NETLOGON_INFO_3 structure.
********************************************************************/
static void init_netlogon_info3(struct netr_NETLOGON_INFO_3 *r,
uint32_t flags,
uint32_t logon_attempts)
{
r->flags = flags;
r->logon_attempts = logon_attempts;
}
/*************************************************************************
_netr_LogonControl
*************************************************************************/
@ -141,10 +101,10 @@ WERROR _netr_LogonControl2(pipes_struct *p,
WERROR _netr_LogonControl2Ex(pipes_struct *p,
struct netr_LogonControl2Ex *r)
{
uint32 flags = 0x0;
uint32 pdc_connection_status = 0x0;
uint32 logon_attempts = 0x0;
uint32 tc_status;
uint32_t flags = 0x0;
WERROR pdc_connection_status = WERR_OK;
uint32_t logon_attempts = 0x0;
WERROR tc_status;
fstring dc_name2;
const char *dc_name = NULL;
struct sockaddr_storage dc_ss;
@ -168,7 +128,7 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
return WERR_INVALID_PARAM;
}
tc_status = W_ERROR_V(WERR_NO_SUCH_DOMAIN);
tc_status = WERR_NO_SUCH_DOMAIN;
switch (r->in.function_code) {
case NETLOGON_CONTROL_TC_QUERY:
@ -178,7 +138,7 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
break;
if ( !get_dc_name( domain, NULL, dc_name2, &dc_ss ) ) {
tc_status = W_ERROR_V(WERR_NO_LOGON_SERVERS);
tc_status = WERR_NO_LOGON_SERVERS;
break;
}
@ -187,7 +147,7 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
return WERR_NOMEM;
}
tc_status = W_ERROR_V(WERR_OK);
tc_status = WERR_OK;
break;
@ -198,7 +158,7 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
break;
if ( !get_dc_name( domain, NULL, dc_name2, &dc_ss ) ) {
tc_status = W_ERROR_V(WERR_NO_LOGON_SERVERS);
tc_status = WERR_NO_LOGON_SERVERS;
break;
}
@ -207,7 +167,7 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
return WERR_NOMEM;
}
tc_status = W_ERROR_V(WERR_OK);
tc_status = WERR_OK;
break;
@ -225,29 +185,29 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
W_ERROR_HAVE_NO_MEMORY(info1);
init_netlogon_info1(info1,
flags,
pdc_connection_status);
info1->flags = flags;
info1->pdc_connection_status = pdc_connection_status;
r->out.query->info1 = info1;
break;
case 2:
info2 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_2);
W_ERROR_HAVE_NO_MEMORY(info2);
init_netlogon_info2(info2,
flags,
pdc_connection_status,
dc_name,
tc_status);
info2->flags = flags;
info2->pdc_connection_status = pdc_connection_status;
info2->trusted_dc_name = dc_name;
info2->tc_connection_status = tc_status;
r->out.query->info2 = info2;
break;
case 3:
info3 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_3);
W_ERROR_HAVE_NO_MEMORY(info3);
init_netlogon_info3(info3,
flags,
logon_attempts);
info3->flags = flags;
info3->logon_attempts = logon_attempts;
r->out.query->info3 = info3;
break;
default: