diff options
-rw-r--r-- | librpc/gen_ndr/cli_netlogon.c | 4 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_netlogon.h | 4 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_netlogon.c | 435 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_netlogon.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/netlogon.h | 61 |
5 files changed, 360 insertions, 146 deletions
diff --git a/librpc/gen_ndr/cli_netlogon.c b/librpc/gen_ndr/cli_netlogon.c index 39eaf7bfe9..d8a9ef304f 100644 --- a/librpc/gen_ndr/cli_netlogon.c +++ b/librpc/gen_ndr/cli_netlogon.c @@ -940,9 +940,9 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server /* [in] [unique,charset(UTF16)] */, - uint32_t function_code /* [in] */, + enum netr_LogonControlCode function_code /* [in] */, uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, + union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, WERROR *werror) { diff --git a/librpc/gen_ndr/cli_netlogon.h b/librpc/gen_ndr/cli_netlogon.h index 873f519b70..ac704484d1 100644 --- a/librpc/gen_ndr/cli_netlogon.h +++ b/librpc/gen_ndr/cli_netlogon.h @@ -164,9 +164,9 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server /* [in] [unique,charset(UTF16)] */, - uint32_t function_code /* [in] */, + enum netr_LogonControlCode function_code /* [in] */, uint32_t level /* [in] */, - union netr_CONTROL_DATA_INFORMATION data /* [in] [switch_is(function_code)] */, + union netr_CONTROL_DATA_INFORMATION *data /* [in] [ref,switch_is(function_code)] */, union netr_CONTROL_QUERY_INFORMATION *query /* [out] [ref,switch_is(level)] */, WERROR *werror); NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, diff --git a/librpc/gen_ndr/ndr_netlogon.c b/librpc/gen_ndr/ndr_netlogon.c index 42bd09cedc..b3894f897c 100644 --- a/librpc/gen_ndr/ndr_netlogon.c +++ b/librpc/gen_ndr/ndr_netlogon.c @@ -5754,6 +5754,99 @@ _PUBLIC_ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char * ndr->depth--; } +static enum ndr_err_code ndr_push_netr_NETLOGON_INFO_4(struct ndr_push *ndr, int ndr_flags, const struct netr_NETLOGON_INFO_4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_dc_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->trusted_dc_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_dc_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->trusted_dc_name, ndr_charset_length(r->trusted_dc_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->trusted_domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->trusted_domain_name, ndr_charset_length(r->trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_NETLOGON_INFO_4(struct ndr_pull *ndr, int ndr_flags, struct netr_NETLOGON_INFO_4 *r) +{ + uint32_t _ptr_trusted_dc_name; + TALLOC_CTX *_mem_save_trusted_dc_name_0; + uint32_t _ptr_trusted_domain_name; + TALLOC_CTX *_mem_save_trusted_domain_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + 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_generic_ptr(ndr, &_ptr_trusted_domain_name)); + if (_ptr_trusted_domain_name) { + NDR_PULL_ALLOC(ndr, r->trusted_domain_name); + } else { + r->trusted_domain_name = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->trusted_dc_name) { + _mem_save_trusted_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusted_dc_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_dc_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_dc_name)); + if (ndr_get_array_length(ndr, &r->trusted_dc_name) > ndr_get_array_size(ndr, &r->trusted_dc_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_dc_name), ndr_get_array_length(ndr, &r->trusted_dc_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_dc_name, ndr_get_array_length(ndr, &r->trusted_dc_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_dc_name_0, 0); + } + if (r->trusted_domain_name) { + _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->trusted_domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->trusted_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->trusted_domain_name)); + if (ndr_get_array_length(ndr, &r->trusted_domain_name) > ndr_get_array_size(ndr, &r->trusted_domain_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->trusted_domain_name), ndr_get_array_length(ndr, &r->trusted_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->trusted_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->trusted_domain_name, ndr_get_array_length(ndr, &r->trusted_domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_NETLOGON_INFO_4(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_4 *r) +{ + ndr_print_struct(ndr, name, "netr_NETLOGON_INFO_4"); + ndr->depth++; + 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_ptr(ndr, "trusted_domain_name", r->trusted_domain_name); + ndr->depth++; + if (r->trusted_domain_name) { + ndr_print_string(ndr, "trusted_domain_name", r->trusted_domain_name); + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push *ndr, int ndr_flags, const union netr_CONTROL_QUERY_INFORMATION *r) { if (ndr_flags & NDR_SCALARS) { @@ -5772,6 +5865,10 @@ static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); break; } + case 4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); + break; } + default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -5797,6 +5894,12 @@ static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push } break; + case 4: + if (r->info4) { + NDR_CHECK(ndr_push_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + } + break; + default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -5811,6 +5914,7 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull TALLOC_CTX *_mem_save_info1_0; TALLOC_CTX *_mem_save_info2_0; TALLOC_CTX *_mem_save_info3_0; + TALLOC_CTX *_mem_save_info4_0; level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); @@ -5848,6 +5952,16 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull } break; } + case 4: { + uint32_t _ptr_info4; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); + if (_ptr_info4) { + NDR_PULL_ALLOC(ndr, r->info4); + } else { + r->info4 = NULL; + } + break; } + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -5881,6 +5995,15 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_QUERY_INFORMATION(struct ndr_pull } break; + case 4: + if (r->info4) { + _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); + NDR_CHECK(ndr_pull_netr_NETLOGON_INFO_4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); + } + break; + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -5921,6 +6044,15 @@ _PUBLIC_ void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, co ndr->depth--; break; + case 4: + ndr_print_ptr(ndr, "info4", r->info4); + ndr->depth++; + if (r->info4) { + ndr_print_netr_NETLOGON_INFO_4(ndr, "info4", r->info4); + } + ndr->depth--; + break; + default: ndr_print_bad_level(ndr, name, level); } @@ -5945,11 +6077,22 @@ _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char const char *val = NULL; switch (r) { - case NETLOGON_CONTROL_SYNC: val = "NETLOGON_CONTROL_SYNC"; break; + case NETLOGON_CONTROL_QUERY: val = "NETLOGON_CONTROL_QUERY"; break; + case NETLOGON_CONTROL_REPLICATE: val = "NETLOGON_CONTROL_REPLICATE"; break; + case NETLOGON_CONTROL_SYNCHRONIZE: val = "NETLOGON_CONTROL_SYNCHRONIZE"; break; + case NETLOGON_CONTROL_PDC_REPLICATE: val = "NETLOGON_CONTROL_PDC_REPLICATE"; break; case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break; case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break; case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break; + case NETLOGON_CONTROL_FIND_USER: val = "NETLOGON_CONTROL_FIND_USER"; break; + case NETLOGON_CONTROL_CHANGE_PASSWORD: val = "NETLOGON_CONTROL_CHANGE_PASSWORD"; break; + case NETLOGON_CONTROL_TC_VERIFY: val = "NETLOGON_CONTROL_TC_VERIFY"; break; + case NETLOGON_CONTROL_FORCE_DNS_REG: val = "NETLOGON_CONTROL_FORCE_DNS_REG"; break; + case NETLOGON_CONTROL_QUERY_DNS_REG: val = "NETLOGON_CONTROL_QUERY_DNS_REG"; break; + case NETLOGON_CONTROL_BACKUP_CHANGE_LOG: val = "NETLOGON_CONTROL_BACKUP_CHANGE_LOG"; break; + case NETLOGON_CONTROL_TRUNCATE_LOG: val = "NETLOGON_CONTROL_TRUNCATE_LOG"; break; case NETLOGON_CONTROL_SET_DBFLAG: val = "NETLOGON_CONTROL_SET_DBFLAG"; break; + case NETLOGON_CONTROL_BREAKPOINT: val = "NETLOGON_CONTROL_BREAKPOINT"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } @@ -5972,6 +6115,18 @@ static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); break; } + case NETLOGON_CONTROL_CHANGE_PASSWORD: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETLOGON_CONTROL_TC_VERIFY: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + break; } + + case NETLOGON_CONTROL_FIND_USER: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); + break; } + case NETLOGON_CONTROL_SET_DBFLAG: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level)); break; } @@ -6010,6 +6165,33 @@ static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push } break; + case NETLOGON_CONTROL_CHANGE_PASSWORD: + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETLOGON_CONTROL_TC_VERIFY: + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + + case NETLOGON_CONTROL_FIND_USER: + if (r->user) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user, ndr_charset_length(r->user, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + break; + case NETLOGON_CONTROL_SET_DBFLAG: break; @@ -6025,6 +6207,7 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull int level; uint32_t _level; TALLOC_CTX *_mem_save_domain_0; + TALLOC_CTX *_mem_save_user_0; level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); @@ -6062,6 +6245,36 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull } break; } + case NETLOGON_CONTROL_CHANGE_PASSWORD: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETLOGON_CONTROL_TC_VERIFY: { + uint32_t _ptr_domain; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + break; } + + case NETLOGON_CONTROL_FIND_USER: { + uint32_t _ptr_user; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user)); + if (_ptr_user) { + NDR_PULL_ALLOC(ndr, r->user); + } else { + r->user = NULL; + } + break; } + case NETLOGON_CONTROL_SET_DBFLAG: { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->debug_level)); break; } @@ -6117,6 +6330,51 @@ static enum ndr_err_code ndr_pull_netr_CONTROL_DATA_INFORMATION(struct ndr_pull } break; + case NETLOGON_CONTROL_CHANGE_PASSWORD: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETLOGON_CONTROL_TC_VERIFY: + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + break; + + case NETLOGON_CONTROL_FIND_USER: + if (r->user) { + _mem_save_user_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user)); + if (ndr_get_array_length(ndr, &r->user) > ndr_get_array_size(ndr, &r->user)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user), ndr_get_array_length(ndr, &r->user)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user, ndr_get_array_length(ndr, &r->user), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_0, 0); + } + break; + case NETLOGON_CONTROL_SET_DBFLAG: break; @@ -6160,6 +6418,33 @@ _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, con ndr->depth--; break; + case NETLOGON_CONTROL_CHANGE_PASSWORD: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETLOGON_CONTROL_TC_VERIFY: + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + break; + + case NETLOGON_CONTROL_FIND_USER: + ndr_print_ptr(ndr, "user", r->user); + ndr->depth++; + if (r->user) { + ndr_print_string(ndr, "user", r->user); + } + ndr->depth--; + break; + case NETLOGON_CONTROL_SET_DBFLAG: ndr_print_uint32(ndr, "debug_level", r->debug_level); break; @@ -6822,113 +7107,6 @@ _PUBLIC_ void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r) -{ - uint32_t cntr_data_1; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - 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->data)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - 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_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->data[cntr_data_1])); - } - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_netr_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct netr_BinaryString *r) -{ - uint32_t _ptr_data; - uint32_t cntr_data_1; - TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_1; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - 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_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->data); - } else { - r->data = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->data) { - _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); - NDR_CHECK(ndr_pull_array_length(ndr, &r->data)); - if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data)); - } - NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); - for (cntr_data_1 = 0; cntr_data_1 < r->length / 2; cntr_data_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data[cntr_data_1])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); - } - if (r->data) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size / 2)); - } - if (r->data) { - NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length / 2)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r) -{ - uint32_t cntr_data_1; - ndr_print_struct(ndr, name, "netr_BinaryString"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); - ndr->depth++; - ndr_print_uint16(ndr, "length", r->length); - ndr_print_uint16(ndr, "size", r->size); - ndr_print_ptr(ndr, "data", r->data); - ndr->depth++; - if (r->data) { - ndr->print(ndr, "%s: ARRAY(%d)", "data", (int)r->length / 2); - ndr->depth++; - for (cntr_data_1=0;cntr_data_1<r->length / 2;cntr_data_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { - ndr_print_uint16(ndr, "data", r->data[cntr_data_1]); - free(idx_1); - } - } - ndr->depth--; - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainQuery1 *r) { uint32_t cntr_unknown7_0; @@ -6941,7 +7119,7 @@ static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int nd NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown2)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown3)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->unknown4)); - NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->blob2)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->product)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); @@ -6987,7 +7165,7 @@ static enum ndr_err_code ndr_push_netr_DomainQuery1(struct ndr_push *ndr, int nd NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unknown4, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unknown4, ndr_charset_length(r->unknown4, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); + NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->product)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); @@ -7049,7 +7227,7 @@ static enum ndr_err_code ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int nd } else { r->unknown4 = NULL; } - NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_SCALARS, &r->blob2)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->blob2)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->product)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown5)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown6)); @@ -7131,7 +7309,7 @@ static enum ndr_err_code ndr_pull_netr_DomainQuery1(struct ndr_pull *ndr, int nd NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unknown4, ndr_get_array_length(ndr, &r->unknown4), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown4_0, 0); } - NDR_CHECK(ndr_pull_netr_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); + NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->blob2)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->product)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown5)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown6)); @@ -7181,7 +7359,7 @@ _PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *nam ndr_print_string(ndr, "unknown4", r->unknown4); } ndr->depth--; - ndr_print_netr_BinaryString(ndr, "blob2", &r->blob2); + ndr_print_lsa_BinaryString(ndr, "blob2", &r->blob2); ndr_print_lsa_String(ndr, "product", &r->product); ndr_print_lsa_String(ndr, "unknown5", &r->unknown5); ndr_print_lsa_String(ndr, "unknown6", &r->unknown6); @@ -11774,10 +11952,13 @@ static enum ndr_err_code ndr_push_netr_LogonControl2Ex(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.logon_server, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.logon_server, ndr_charset_length(r->in.logon_server, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.function_code)); + NDR_CHECK(ndr_push_netr_LogonControlCode(ndr, NDR_SCALARS, r->in.function_code)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.data, r->in.function_code)); - NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code)); + NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); } if (flags & NDR_OUT) { if (r->out.query == NULL) { @@ -11794,6 +11975,7 @@ static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int { uint32_t _ptr_logon_server; TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_data_0; TALLOC_CTX *_mem_save_query_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11816,10 +11998,16 @@ static enum ndr_err_code ndr_pull_netr_LogonControl2Ex(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.logon_server, ndr_get_array_length(ndr, &r->in.logon_server), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_server_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.function_code)); + NDR_CHECK(ndr_pull_netr_LogonControlCode(ndr, NDR_SCALARS, &r->in.function_code)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.data, r->in.function_code)); - NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code)); + NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.query); ZERO_STRUCTP(r->out.query); } @@ -11853,10 +12041,13 @@ _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char * ndr_print_string(ndr, "logon_server", r->in.logon_server); } ndr->depth--; - ndr_print_uint32(ndr, "function_code", r->in.function_code); + ndr_print_netr_LogonControlCode(ndr, "function_code", r->in.function_code); ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.data, r->in.function_code); - ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", &r->in.data); + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code); + ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { diff --git a/librpc/gen_ndr/ndr_netlogon.h b/librpc/gen_ndr/ndr_netlogon.h index aab691e504..96c487f170 100644 --- a/librpc/gen_ndr/ndr_netlogon.h +++ b/librpc/gen_ndr/ndr_netlogon.h @@ -187,6 +187,7 @@ void ndr_print_netr_InfoFlags(struct ndr_print *ndr, const char *name, uint32_t void ndr_print_netr_NETLOGON_INFO_1(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_1 *r); void ndr_print_netr_NETLOGON_INFO_2(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_2 *r); void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_3 *r); +void ndr_print_netr_NETLOGON_INFO_4(struct ndr_print *ndr, const char *name, const struct netr_NETLOGON_INFO_4 *r); void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r); void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r); void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r); @@ -205,7 +206,6 @@ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_f enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r); void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r); void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r); void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r); void ndr_print_netr_trust_extension(struct ndr_print *ndr, const char *name, const struct netr_trust_extension *r); diff --git a/librpc/gen_ndr/netlogon.h b/librpc/gen_ndr/netlogon.h index b4de53bf7b..c0507b1e2d 100644 --- a/librpc/gen_ndr/netlogon.h +++ b/librpc/gen_ndr/netlogon.h @@ -654,33 +654,62 @@ struct netr_NETLOGON_INFO_3 { uint32_t unknown5; }; +struct netr_NETLOGON_INFO_4 { + const char *trusted_dc_name;/* [unique,charset(UTF16)] */ + const char *trusted_domain_name;/* [unique,charset(UTF16)] */ +}; + union netr_CONTROL_QUERY_INFORMATION { struct netr_NETLOGON_INFO_1 *info1;/* [unique,case] */ struct netr_NETLOGON_INFO_2 *info2;/* [unique,case(2)] */ struct netr_NETLOGON_INFO_3 *info3;/* [unique,case(3)] */ + struct netr_NETLOGON_INFO_4 *info4;/* [unique,case(4)] */ }; enum netr_LogonControlCode #ifndef USE_UINT_ENUMS { - NETLOGON_CONTROL_SYNC=2, - NETLOGON_CONTROL_REDISCOVER=5, - NETLOGON_CONTROL_TC_QUERY=6, - NETLOGON_CONTROL_TRANSPORT_NOTIFY=7, - NETLOGON_CONTROL_SET_DBFLAG=65534 + NETLOGON_CONTROL_QUERY=0x00000001, + NETLOGON_CONTROL_REPLICATE=0x00000002, + NETLOGON_CONTROL_SYNCHRONIZE=0x00000003, + NETLOGON_CONTROL_PDC_REPLICATE=0x00000004, + NETLOGON_CONTROL_REDISCOVER=0x00000005, + NETLOGON_CONTROL_TC_QUERY=0x00000006, + NETLOGON_CONTROL_TRANSPORT_NOTIFY=0x00000007, + NETLOGON_CONTROL_FIND_USER=0x00000008, + NETLOGON_CONTROL_CHANGE_PASSWORD=0x00000009, + NETLOGON_CONTROL_TC_VERIFY=0x0000000A, + NETLOGON_CONTROL_FORCE_DNS_REG=0x0000000B, + NETLOGON_CONTROL_QUERY_DNS_REG=0x0000000C, + NETLOGON_CONTROL_BACKUP_CHANGE_LOG=0x0000FFFC, + NETLOGON_CONTROL_TRUNCATE_LOG=0x0000FFFD, + NETLOGON_CONTROL_SET_DBFLAG=0x0000FFFE, + NETLOGON_CONTROL_BREAKPOINT=0x0000FFFF } #else { __donnot_use_enum_netr_LogonControlCode=0x7FFFFFFF} -#define NETLOGON_CONTROL_SYNC ( 2 ) -#define NETLOGON_CONTROL_REDISCOVER ( 5 ) -#define NETLOGON_CONTROL_TC_QUERY ( 6 ) -#define NETLOGON_CONTROL_TRANSPORT_NOTIFY ( 7 ) -#define NETLOGON_CONTROL_SET_DBFLAG ( 65534 ) +#define NETLOGON_CONTROL_QUERY ( 0x00000001 ) +#define NETLOGON_CONTROL_REPLICATE ( 0x00000002 ) +#define NETLOGON_CONTROL_SYNCHRONIZE ( 0x00000003 ) +#define NETLOGON_CONTROL_PDC_REPLICATE ( 0x00000004 ) +#define NETLOGON_CONTROL_REDISCOVER ( 0x00000005 ) +#define NETLOGON_CONTROL_TC_QUERY ( 0x00000006 ) +#define NETLOGON_CONTROL_TRANSPORT_NOTIFY ( 0x00000007 ) +#define NETLOGON_CONTROL_FIND_USER ( 0x00000008 ) +#define NETLOGON_CONTROL_CHANGE_PASSWORD ( 0x00000009 ) +#define NETLOGON_CONTROL_TC_VERIFY ( 0x0000000A ) +#define NETLOGON_CONTROL_FORCE_DNS_REG ( 0x0000000B ) +#define NETLOGON_CONTROL_QUERY_DNS_REG ( 0x0000000C ) +#define NETLOGON_CONTROL_BACKUP_CHANGE_LOG ( 0x0000FFFC ) +#define NETLOGON_CONTROL_TRUNCATE_LOG ( 0x0000FFFD ) +#define NETLOGON_CONTROL_SET_DBFLAG ( 0x0000FFFE ) +#define NETLOGON_CONTROL_BREAKPOINT ( 0x0000FFFF ) #endif ; union netr_CONTROL_DATA_INFORMATION { const char *domain;/* [unique,charset(UTF16),case(NETLOGON_CONTROL_REDISCOVER)] */ + const char *user;/* [unique,charset(UTF16),case(NETLOGON_CONTROL_FIND_USER)] */ uint32_t debug_level;/* [case(NETLOGON_CONTROL_SET_DBFLAG)] */ }; @@ -810,12 +839,6 @@ struct netr_DsRGetDCNameInfo { #define NETR_TRUST_FLAG_MIT_KRB5 ( 0x00000080 ) #define NETR_TRUST_FLAG_AES ( 0x00000100 ) -struct netr_BinaryString { - uint16_t length; - uint16_t size; - uint16_t *data;/* [unique,length_is(length/2),size_is(size/2)] */ -}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; - struct netr_DomainQuery1 { struct netr_Blob blob; const char *workstation_domain;/* [unique,charset(UTF16)] */ @@ -824,7 +847,7 @@ struct netr_DomainQuery1 { const char *unknown2;/* [unique,charset(UTF16)] */ const char *unknown3;/* [unique,charset(UTF16)] */ const char *unknown4;/* [unique,charset(UTF16)] */ - struct netr_BinaryString blob2; + struct lsa_BinaryString blob2; struct lsa_String product; struct lsa_String unknown5; struct lsa_String unknown6; @@ -1296,9 +1319,9 @@ struct netr_DatabaseRedo { struct netr_LogonControl2Ex { struct { const char *logon_server;/* [unique,charset(UTF16)] */ - uint32_t function_code; + enum netr_LogonControlCode function_code; uint32_t level; - union netr_CONTROL_DATA_INFORMATION data;/* [switch_is(function_code)] */ + union netr_CONTROL_DATA_INFORMATION *data;/* [ref,switch_is(function_code)] */ } in; struct { |