diff options
-rw-r--r-- | source3/librpc/gen_ndr/lsa.h | 6 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_lsa.c | 92 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_lsa.h | 3 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_netlogon.c | 91 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_netlogon.h | 2 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/netlogon.h | 11 |
6 files changed, 128 insertions, 77 deletions
diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h index 4fea08e99d..4285a5730e 100644 --- a/source3/librpc/gen_ndr/lsa.h +++ b/source3/librpc/gen_ndr/lsa.h @@ -40,6 +40,12 @@ struct lsa_AsciiStringLarge { const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ }/* [public] */; +struct lsa_BinaryString { + uint16_t length; + uint16_t size; + uint16_t *string;/* [unique,length_is(length/2),size_is(size/2)] */ +}/* [public] */; + struct lsa_LUID { uint32_t low; uint32_t high; diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c index 03e1c21e55..d881093272 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.c +++ b/source3/librpc/gen_ndr/ndr_lsa.c @@ -374,6 +374,98 @@ _PUBLIC_ void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r) +{ + uint32_t cntr_string_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); + for (cntr_string_1 = 0; cntr_string_1 < r->length / 2; cntr_string_1++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->string[cntr_string_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r) +{ + uint32_t _ptr_string; + uint32_t cntr_string_1; + TALLOC_CTX *_mem_save_string_0; + TALLOC_CTX *_mem_save_string_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_PULL_ALLOC_N(ndr, r->string, ndr_get_array_size(ndr, &r->string)); + _mem_save_string_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + for (cntr_string_1 = 0; cntr_string_1 < r->length / 2; cntr_string_1++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->string[cntr_string_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r) +{ + uint32_t cntr_string_1; + ndr_print_struct(ndr, name, "lsa_BinaryString"); + ndr->depth++; + ndr_print_uint16(ndr, "length", r->length); + ndr_print_uint16(ndr, "size", r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr->print(ndr, "%s: ARRAY(%d)", "string", r->length / 2); + ndr->depth++; + for (cntr_string_1=0;cntr_string_1<r->length / 2;cntr_string_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_string_1) != -1) { + ndr_print_uint16(ndr, "string", r->string[cntr_string_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUID *r) { if (ndr_flags & NDR_SCALARS) { diff --git a/source3/librpc/gen_ndr/ndr_lsa.h b/source3/librpc/gen_ndr/ndr_lsa.h index a96f2d41b9..a489b5423e 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.h +++ b/source3/librpc/gen_ndr/ndr_lsa.h @@ -191,6 +191,9 @@ void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const st enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r); enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r); void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r); +enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r); +enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r); +void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r); void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r); void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r); void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r); diff --git a/source3/librpc/gen_ndr/ndr_netlogon.c b/source3/librpc/gen_ndr/ndr_netlogon.c index b48a26fb52..86535ca885 100644 --- a/source3/librpc/gen_ndr/ndr_netlogon.c +++ b/source3/librpc/gen_ndr/ndr_netlogon.c @@ -234,95 +234,42 @@ _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *na ndr->depth--; } -static enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r) +_PUBLIC_ enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r) { - uint32_t cntr_bindata_1; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->bindata)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->reset_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_attempt_lockout)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dummy)); } if (ndr_flags & NDR_BUFFERS) { - if (r->bindata) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2)); - for (cntr_bindata_1 = 0; cntr_bindata_1 < r->length / 2; cntr_bindata_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bindata[cntr_bindata_1])); - } - } } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r) +_PUBLIC_ enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r) { - uint32_t _ptr_bindata; - uint32_t cntr_bindata_1; - TALLOC_CTX *_mem_save_bindata_0; - TALLOC_CTX *_mem_save_bindata_1; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bindata)); - if (_ptr_bindata) { - NDR_PULL_ALLOC(ndr, r->bindata); - } else { - r->bindata = NULL; - } + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->reset_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_attempt_lockout)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dummy)); } if (ndr_flags & NDR_BUFFERS) { - if (r->bindata) { - _mem_save_bindata_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->bindata, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->bindata)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->bindata)); - if (ndr_get_array_length(ndr, &r->bindata) > ndr_get_array_size(ndr, &r->bindata)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bindata), ndr_get_array_length(ndr, &r->bindata)); - } - NDR_PULL_ALLOC_N(ndr, r->bindata, ndr_get_array_size(ndr, &r->bindata)); - _mem_save_bindata_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->bindata, 0); - for (cntr_bindata_1 = 0; cntr_bindata_1 < r->length / 2; cntr_bindata_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bindata[cntr_bindata_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bindata_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bindata_0, 0); - } - if (r->bindata) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bindata, r->size / 2)); - } - if (r->bindata) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bindata, r->length / 2)); - } } return NDR_ERR_SUCCESS; } _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r) { - uint32_t cntr_bindata_1; ndr_print_struct(ndr, name, "netr_AcctLockStr"); ndr->depth++; - ndr_print_uint16(ndr, "size", r->size); - ndr_print_uint16(ndr, "length", r->length); - ndr_print_ptr(ndr, "bindata", r->bindata); - ndr->depth++; - if (r->bindata) { - ndr->print(ndr, "%s: ARRAY(%d)", "bindata", r->length / 2); - ndr->depth++; - for (cntr_bindata_1=0;cntr_bindata_1<r->length / 2;cntr_bindata_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_bindata_1) != -1) { - ndr_print_uint16(ndr, "bindata", r->bindata[cntr_bindata_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; + ndr_print_dlong(ndr, "lockout_duration", r->lockout_duration); + ndr_print_udlong(ndr, "reset_count", r->reset_count); + ndr_print_uint32(ndr, "bad_attempt_lockout", r->bad_attempt_lockout); + ndr_print_uint32(ndr, "dummy", r->dummy); ndr->depth--; } @@ -2483,7 +2430,7 @@ static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int nd NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation)); NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_push_netr_AcctLockStr(ndr, NDR_SCALARS, &r->account_lockout)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); @@ -2496,7 +2443,7 @@ static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int nd NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_push_netr_AcctLockStr(ndr, NDR_BUFFERS, &r->account_lockout)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); @@ -2519,7 +2466,7 @@ static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int nd NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation)); NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf)); - NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr, NDR_SCALARS, &r->account_lockout)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4)); @@ -2532,7 +2479,7 @@ static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int nd NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf)); - NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr, NDR_BUFFERS, &r->account_lockout)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4)); @@ -2555,7 +2502,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *nam ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation); ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf); - ndr_print_netr_AcctLockStr(ndr, "account_lockout", &r->account_lockout); + ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout); ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); ndr_print_lsa_String(ndr, "unknown4", &r->unknown4); diff --git a/source3/librpc/gen_ndr/ndr_netlogon.h b/source3/librpc/gen_ndr/ndr_netlogon.h index def076ccc4..dd9466b809 100644 --- a/source3/librpc/gen_ndr/ndr_netlogon.h +++ b/source3/librpc/gen_ndr/ndr_netlogon.h @@ -108,6 +108,8 @@ extern const struct ndr_interface_table ndr_table_netlogon; #define NDR_NETLOGON_CALL_COUNT (47) void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r); +enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r); +enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r); void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r); enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r); enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); diff --git a/source3/librpc/gen_ndr/netlogon.h b/source3/librpc/gen_ndr/netlogon.h index 6f772769be..b51c7cbd7d 100644 --- a/source3/librpc/gen_ndr/netlogon.h +++ b/source3/librpc/gen_ndr/netlogon.h @@ -38,10 +38,11 @@ struct netr_UasLogoffInfo { }; struct netr_AcctLockStr { - uint16_t size; - uint16_t length; - uint16_t *bindata;/* [unique,length_is(length/2),size_is(size/2)] */ -}; + int64_t lockout_duration; + uint64_t reset_count; + uint32_t bad_attempt_lockout; + uint32_t dummy; +}/* [public] */; /* bitmap netr_LogonParameterControl */ #define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED ( 0x00000002 ) @@ -309,7 +310,7 @@ struct netr_DELTA_DOMAIN { NTTIME domain_create_time; uint32_t SecurityInformation; struct sec_desc_buf sdbuf; - struct netr_AcctLockStr account_lockout; + struct lsa_BinaryString account_lockout; struct lsa_String unknown2; struct lsa_String unknown3; struct lsa_String unknown4; |