#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/ndr_netlogon.h"
_PUBLIC_ enum ndr_err_code ndr_push_winbind_status(struct ndr_push *ndr, int ndr_flags, enum winbind_status r)
{
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
ndr->depth--;
}
+static enum ndr_err_code ndr_push_winbind_auth_level(struct ndr_push *ndr, int ndr_flags, enum winbind_auth_level r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_auth_level(struct ndr_pull *ndr, int ndr_flags, enum winbind_auth_level *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_auth_level(struct ndr_print *ndr, const char *name, enum winbind_auth_level r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN: val = "WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static enum ndr_err_code ndr_push_STRUCT_winbind_auth_compat_auth_plain_req(struct ndr_push *ndr, int ndr_flags, const struct winbind_auth_compat_auth_plain_req *r)
+{
+ uint32_t cntr_require_membership_of_sids_1;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->password, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->password, ndr_charset_length(r->password, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_require_membership_of_sids));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->require_membership_of_sids));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->krb5_cc_type));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->uid));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->domain_name) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ }
+ if (r->require_membership_of_sids) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_require_membership_of_sids));
+ for (cntr_require_membership_of_sids_1 = 0; cntr_require_membership_of_sids_1 < r->num_require_membership_of_sids; cntr_require_membership_of_sids_1++) {
+ NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->require_membership_of_sids[cntr_require_membership_of_sids_1]));
+ }
+ for (cntr_require_membership_of_sids_1 = 0; cntr_require_membership_of_sids_1 < r->num_require_membership_of_sids; cntr_require_membership_of_sids_1++) {
+ NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->require_membership_of_sids[cntr_require_membership_of_sids_1]));
+ }
+ }
+ if (r->krb5_cc_type) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->krb5_cc_type, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->krb5_cc_type, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->krb5_cc_type, ndr_charset_length(r->krb5_cc_type, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ }
+ if (r->uid) {
+ NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->uid));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_STRUCT_winbind_auth_compat_auth_plain_req(struct ndr_pull *ndr, int ndr_flags, struct winbind_auth_compat_auth_plain_req *r)
+{
+ uint32_t _ptr_domain_name;
+ TALLOC_CTX *_mem_save_domain_name_0;
+ uint32_t _ptr_require_membership_of_sids;
+ uint32_t cntr_require_membership_of_sids_1;
+ TALLOC_CTX *_mem_save_require_membership_of_sids_0;
+ TALLOC_CTX *_mem_save_require_membership_of_sids_1;
+ uint32_t _ptr_krb5_cc_type;
+ TALLOC_CTX *_mem_save_krb5_cc_type_0;
+ uint32_t _ptr_uid;
+ TALLOC_CTX *_mem_save_uid_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
+ if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_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->account_name), ndr_get_array_length(ndr, &r->account_name));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t), CH_UTF8));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
+ if (_ptr_domain_name) {
+ NDR_PULL_ALLOC(ndr, r->domain_name);
+ } else {
+ r->domain_name = NULL;
+ }
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->password));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->password));
+ if (ndr_get_array_length(ndr, &r->password) > ndr_get_array_size(ndr, &r->password)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->password), ndr_get_array_length(ndr, &r->password));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->password), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->password, ndr_get_array_length(ndr, &r->password), sizeof(uint8_t), CH_UTF8));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_require_membership_of_sids));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_require_membership_of_sids));
+ if (_ptr_require_membership_of_sids) {
+ NDR_PULL_ALLOC(ndr, r->require_membership_of_sids);
+ } else {
+ r->require_membership_of_sids = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_krb5_cc_type));
+ if (_ptr_krb5_cc_type) {
+ NDR_PULL_ALLOC(ndr, r->krb5_cc_type);
+ } else {
+ r->krb5_cc_type = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uid));
+ if (_ptr_uid) {
+ NDR_PULL_ALLOC(ndr, r->uid);
+ } else {
+ r->uid = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->domain_name) {
+ _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
+ if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->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->domain_name), ndr_get_array_length(ndr, &r->domain_name));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint8_t), CH_UTF8));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
+ }
+ if (r->require_membership_of_sids) {
+ _mem_save_require_membership_of_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->require_membership_of_sids, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->require_membership_of_sids));
+ NDR_PULL_ALLOC_N(ndr, r->require_membership_of_sids, ndr_get_array_size(ndr, &r->require_membership_of_sids));
+ _mem_save_require_membership_of_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->require_membership_of_sids, 0);
+ for (cntr_require_membership_of_sids_1 = 0; cntr_require_membership_of_sids_1 < r->num_require_membership_of_sids; cntr_require_membership_of_sids_1++) {
+ NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->require_membership_of_sids[cntr_require_membership_of_sids_1]));
+ }
+ for (cntr_require_membership_of_sids_1 = 0; cntr_require_membership_of_sids_1 < r->num_require_membership_of_sids; cntr_require_membership_of_sids_1++) {
+ NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->require_membership_of_sids[cntr_require_membership_of_sids_1]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_require_membership_of_sids_1, 0);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_require_membership_of_sids_0, 0);
+ }
+ if (r->krb5_cc_type) {
+ _mem_save_krb5_cc_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->krb5_cc_type, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->krb5_cc_type));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->krb5_cc_type));
+ if (ndr_get_array_length(ndr, &r->krb5_cc_type) > ndr_get_array_size(ndr, &r->krb5_cc_type)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->krb5_cc_type), ndr_get_array_length(ndr, &r->krb5_cc_type));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->krb5_cc_type), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->krb5_cc_type, ndr_get_array_length(ndr, &r->krb5_cc_type), sizeof(uint8_t), CH_UTF8));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_krb5_cc_type_0, 0);
+ }
+ if (r->uid) {
+ _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->uid, 0);
+ NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->uid));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, 0);
+ }
+ if (r->require_membership_of_sids) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->require_membership_of_sids, r->num_require_membership_of_sids));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_STRUCT_winbind_auth_compat_auth_plain_req(struct ndr_print *ndr, const char *name, const struct winbind_auth_compat_auth_plain_req *r)
+{
+ uint32_t cntr_require_membership_of_sids_1;
+ ndr_print_struct(ndr, name, "winbind_auth_compat_auth_plain_req");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "flags", r->flags);
+ ndr_print_string(ndr, "account_name", r->account_name);
+ ndr_print_ptr(ndr, "domain_name", r->domain_name);
+ ndr->depth++;
+ if (r->domain_name) {
+ ndr_print_string(ndr, "domain_name", r->domain_name);
+ }
+ ndr->depth--;
+ ndr_print_string(ndr, "password", r->password);
+ ndr_print_uint32(ndr, "num_require_membership_of_sids", r->num_require_membership_of_sids);
+ ndr_print_ptr(ndr, "require_membership_of_sids", r->require_membership_of_sids);
+ ndr->depth++;
+ if (r->require_membership_of_sids) {
+ ndr->print(ndr, "%s: ARRAY(%d)", "require_membership_of_sids", r->num_require_membership_of_sids);
+ ndr->depth++;
+ for (cntr_require_membership_of_sids_1=0;cntr_require_membership_of_sids_1<r->num_require_membership_of_sids;cntr_require_membership_of_sids_1++) {
+ char *idx_1=NULL;
+ if (asprintf(&idx_1, "[%d]", cntr_require_membership_of_sids_1) != -1) {
+ ndr_print_dom_sid(ndr, "require_membership_of_sids", &r->require_membership_of_sids[cntr_require_membership_of_sids_1]);
+ free(idx_1);
+ }
+ }
+ ndr->depth--;
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "krb5_cc_type", r->krb5_cc_type);
+ ndr->depth++;
+ if (r->krb5_cc_type) {
+ ndr_print_string(ndr, "krb5_cc_type", r->krb5_cc_type);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "uid", r->uid);
+ ndr->depth++;
+ if (r->uid) {
+ ndr_print_hyper(ndr, "uid", *r->uid);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_STRUCT_winbind_auth_compat_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct winbind_auth_compat_auth_rep *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->unix_username));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->krb5_cc_name));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->password_policy));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->afs_token));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->unix_username) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unix_username, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->unix_username, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->unix_username, ndr_charset_length(r->unix_username, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ }
+ if (r->krb5_cc_name) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->krb5_cc_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->krb5_cc_name, CH_UTF8)));
+ NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->krb5_cc_name, ndr_charset_length(r->krb5_cc_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+ }
+ if (r->info3) {
+ NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
+ }
+ if (r->password_policy) {
+ NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->password_policy));
+ }
+ if (r->afs_token) {
+ NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->afs_token));
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_STRUCT_winbind_auth_compat_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct winbind_auth_compat_auth_rep *r)
+{
+ uint32_t _ptr_unix_username;
+ TALLOC_CTX *_mem_save_unix_username_0;
+ uint32_t _ptr_krb5_cc_name;
+ TALLOC_CTX *_mem_save_krb5_cc_name_0;
+ uint32_t _ptr_info3;
+ TALLOC_CTX *_mem_save_info3_0;
+ uint32_t _ptr_password_policy;
+ TALLOC_CTX *_mem_save_password_policy_0;
+ uint32_t _ptr_afs_token;
+ TALLOC_CTX *_mem_save_afs_token_0;
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unix_username));
+ if (_ptr_unix_username) {
+ NDR_PULL_ALLOC(ndr, r->unix_username);
+ } else {
+ r->unix_username = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_krb5_cc_name));
+ if (_ptr_krb5_cc_name) {
+ NDR_PULL_ALLOC(ndr, r->krb5_cc_name);
+ } else {
+ r->krb5_cc_name = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
+ if (_ptr_info3) {
+ NDR_PULL_ALLOC(ndr, r->info3);
+ } else {
+ r->info3 = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password_policy));
+ if (_ptr_password_policy) {
+ NDR_PULL_ALLOC(ndr, r->password_policy);
+ } else {
+ r->password_policy = NULL;
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_afs_token));
+ if (_ptr_afs_token) {
+ NDR_PULL_ALLOC(ndr, r->afs_token);
+ } else {
+ r->afs_token = NULL;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ if (r->unix_username) {
+ _mem_save_unix_username_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->unix_username, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->unix_username));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->unix_username));
+ if (ndr_get_array_length(ndr, &r->unix_username) > ndr_get_array_size(ndr, &r->unix_username)) {
+ return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->unix_username), ndr_get_array_length(ndr, &r->unix_username));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->unix_username), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->unix_username, ndr_get_array_length(ndr, &r->unix_username), sizeof(uint8_t), CH_UTF8));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unix_username_0, 0);
+ }
+ if (r->krb5_cc_name) {
+ _mem_save_krb5_cc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->krb5_cc_name, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->krb5_cc_name));
+ NDR_CHECK(ndr_pull_array_length(ndr, &r->krb5_cc_name));
+ if (ndr_get_array_length(ndr, &r->krb5_cc_name) > ndr_get_array_size(ndr, &r->krb5_cc_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->krb5_cc_name), ndr_get_array_length(ndr, &r->krb5_cc_name));
+ }
+ NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->krb5_cc_name), sizeof(uint8_t)));
+ NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->krb5_cc_name, ndr_get_array_length(ndr, &r->krb5_cc_name), sizeof(uint8_t), CH_UTF8));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_krb5_cc_name_0, 0);
+ }
+ if (r->info3) {
+ _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
+ NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
+ }
+ if (r->password_policy) {
+ _mem_save_password_policy_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->password_policy, 0);
+ NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->password_policy));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_policy_0, 0);
+ }
+ if (r->afs_token) {
+ _mem_save_afs_token_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->afs_token, 0);
+ NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->afs_token));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_afs_token_0, 0);
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_STRUCT_winbind_auth_compat_auth_rep(struct ndr_print *ndr, const char *name, const struct winbind_auth_compat_auth_rep *r)
+{
+ ndr_print_struct(ndr, name, "winbind_auth_compat_auth_rep");
+ ndr->depth++;
+ ndr_print_ptr(ndr, "unix_username", r->unix_username);
+ ndr->depth++;
+ if (r->unix_username) {
+ ndr_print_string(ndr, "unix_username", r->unix_username);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "krb5_cc_name", r->krb5_cc_name);
+ ndr->depth++;
+ if (r->krb5_cc_name) {
+ ndr_print_string(ndr, "krb5_cc_name", r->krb5_cc_name);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "info3", r->info3);
+ ndr->depth++;
+ if (r->info3) {
+ ndr_print_netr_SamInfo3(ndr, "info3", r->info3);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "password_policy", r->password_policy);
+ ndr->depth++;
+ if (r->password_policy) {
+ ndr_print_samr_DomInfo1(ndr, "password_policy", r->password_policy);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "afs_token", r->afs_token);
+ ndr->depth++;
+ if (r->afs_token) {
+ ndr_print_DATA_BLOB(ndr, "afs_token", *r->afs_token);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_winbind_auth_req(struct ndr_push *ndr, int ndr_flags, const union winbind_auth_req *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ NDR_CHECK(ndr_push_winbind_auth_level(ndr, NDR_SCALARS, level));
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN: {
+ NDR_CHECK(ndr_push_STRUCT_winbind_auth_compat_auth_plain_req(ndr, NDR_SCALARS, &r->compat_auth_plain));
+ break; }
+
+ default: {
+ break; }
+
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ NDR_CHECK(ndr_push_STRUCT_winbind_auth_compat_auth_plain_req(ndr, NDR_BUFFERS, &r->compat_auth_plain));
+ break;
+
+ default:
+ break;
+
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_auth_req(struct ndr_pull *ndr, int ndr_flags, union winbind_auth_req *r)
+{
+ int level;
+ uint32_t _level;
+ level = ndr_pull_get_switch_value(ndr, r);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
+ if (_level != level) {
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+ }
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN: {
+ NDR_CHECK(ndr_pull_STRUCT_winbind_auth_compat_auth_plain_req(ndr, NDR_SCALARS, &r->compat_auth_plain));
+ break; }
+
+ default: {
+ break; }
+
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ NDR_CHECK(ndr_pull_STRUCT_winbind_auth_compat_auth_plain_req(ndr, NDR_BUFFERS, &r->compat_auth_plain));
+ break;
+
+ default:
+ break;
+
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_auth_req(struct ndr_print *ndr, const char *name, const union winbind_auth_req *r)
+{
+ int level;
+ level = ndr_print_get_switch_value(ndr, r);
+ ndr_print_union(ndr, name, level, "winbind_auth_req");
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ ndr_print_STRUCT_winbind_auth_compat_auth_plain_req(ndr, "compat_auth_plain", &r->compat_auth_plain);
+ break;
+
+ default:
+ break;
+
+ }
+}
+
+static enum ndr_err_code ndr_push_winbind_auth_rep(struct ndr_push *ndr, int ndr_flags, const union winbind_auth_rep *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ NDR_CHECK(ndr_push_winbind_auth_level(ndr, NDR_SCALARS, level));
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN: {
+ NDR_CHECK(ndr_push_STRUCT_winbind_auth_compat_auth_rep(ndr, NDR_SCALARS, &r->compat_auth));
+ break; }
+
+ default: {
+ break; }
+
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ int level = ndr_push_get_switch_value(ndr, r);
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ NDR_CHECK(ndr_push_STRUCT_winbind_auth_compat_auth_rep(ndr, NDR_BUFFERS, &r->compat_auth));
+ break;
+
+ default:
+ break;
+
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_auth_rep(struct ndr_pull *ndr, int ndr_flags, union winbind_auth_rep *r)
+{
+ int level;
+ uint32_t _level;
+ level = ndr_pull_get_switch_value(ndr, r);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
+ if (_level != level) {
+ return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+ }
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN: {
+ NDR_CHECK(ndr_pull_STRUCT_winbind_auth_compat_auth_rep(ndr, NDR_SCALARS, &r->compat_auth));
+ break; }
+
+ default: {
+ break; }
+
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ NDR_CHECK(ndr_pull_STRUCT_winbind_auth_compat_auth_rep(ndr, NDR_BUFFERS, &r->compat_auth));
+ break;
+
+ default:
+ break;
+
+ }
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_auth_rep(struct ndr_print *ndr, const char *name, const union winbind_auth_rep *r)
+{
+ int level;
+ level = ndr_print_get_switch_value(ndr, r);
+ ndr_print_union(ndr, name, level, "winbind_auth_rep");
+ switch (level) {
+ case WINBIND_AUTH_LEVEL_COMPAT_AUTH_PLAIN:
+ ndr_print_STRUCT_winbind_auth_compat_auth_rep(ndr, "compat_auth", &r->compat_auth);
+ break;
+
+ default:
+ break;
+
+ }
+}
+
static enum ndr_err_code ndr_push_winbind_trust_level(struct ndr_push *ndr, int ndr_flags, enum winbind_trust_level r)
{
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
ndr->depth--;
}
-static enum ndr_err_code ndr_push_winbind_pam_auth(struct ndr_push *ndr, int flags, const struct winbind_pam_auth *r)
+static enum ndr_err_code ndr_push_winbind_auth(struct ndr_push *ndr, int flags, const struct winbind_auth *r)
{
if (flags & NDR_IN) {
+ if (r->in.level == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_winbind_auth_level(ndr, NDR_SCALARS, *r->in.level));
+ NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, *r->in.level));
+ NDR_CHECK(ndr_push_winbind_auth_req(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
}
if (flags & NDR_OUT) {
+ if (r->out.rep == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.rep, *r->in.level));
+ NDR_CHECK(ndr_push_winbind_auth_rep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep));
NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
}
-static enum ndr_err_code ndr_pull_winbind_pam_auth(struct ndr_pull *ndr, int flags, struct winbind_pam_auth *r)
+static enum ndr_err_code ndr_pull_winbind_auth(struct ndr_pull *ndr, int flags, struct winbind_auth *r)
{
+ TALLOC_CTX *_mem_save_level_0;
+ TALLOC_CTX *_mem_save_rep_0;
if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.level);
+ }
+ _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.level, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_winbind_auth_level(ndr, NDR_SCALARS, r->in.level));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, *r->in.level));
+ NDR_CHECK(ndr_pull_winbind_auth_req(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
+ NDR_PULL_ALLOC(ndr, r->out.rep);
+ ZERO_STRUCTP(r->out.rep);
}
if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.rep);
+ }
+ _mem_save_rep_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.rep, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.rep, *r->in.level));
+ NDR_CHECK(ndr_pull_winbind_auth_rep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ void ndr_print_winbind_pam_auth(struct ndr_print *ndr, const char *name, int flags, const struct winbind_pam_auth *r)
+_PUBLIC_ void ndr_print_winbind_auth(struct ndr_print *ndr, const char *name, int flags, const struct winbind_auth *r)
{
- ndr_print_struct(ndr, name, "winbind_pam_auth");
+ ndr_print_struct(ndr, name, "winbind_auth");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
ndr->flags |= LIBNDR_PRINT_SET_VALUES;
}
if (flags & NDR_IN) {
- ndr_print_struct(ndr, "in", "winbind_pam_auth");
+ ndr_print_struct(ndr, "in", "winbind_auth");
ndr->depth++;
- ndr->depth--;
- }
- if (flags & NDR_OUT) {
- ndr_print_struct(ndr, "out", "winbind_pam_auth");
+ ndr_print_ptr(ndr, "level", r->in.level);
ndr->depth++;
- ndr_print_winbind_status(ndr, "result", r->out.result);
+ ndr_print_winbind_auth_level(ndr, "level", *r->in.level);
ndr->depth--;
- }
- ndr->depth--;
-}
-
-static enum ndr_err_code ndr_push_winbind_pam_auth_crap(struct ndr_push *ndr, int flags, const struct winbind_pam_auth_crap *r)
-{
- if (flags & NDR_IN) {
- }
- if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
- }
- return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_winbind_pam_auth_crap(struct ndr_pull *ndr, int flags, struct winbind_pam_auth_crap *r)
-{
- if (flags & NDR_IN) {
- }
- if (flags & NDR_OUT) {
- NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
- }
- return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_winbind_pam_auth_crap(struct ndr_print *ndr, const char *name, int flags, const struct winbind_pam_auth_crap *r)
-{
- ndr_print_struct(ndr, name, "winbind_pam_auth_crap");
- ndr->depth++;
- if (flags & NDR_SET_VALUES) {
- ndr->flags |= LIBNDR_PRINT_SET_VALUES;
- }
- if (flags & NDR_IN) {
- ndr_print_struct(ndr, "in", "winbind_pam_auth_crap");
- ndr->depth++;
+ ndr_print_set_switch_value(ndr, &r->in.req, *r->in.level);
+ ndr_print_winbind_auth_req(ndr, "req", &r->in.req);
ndr->depth--;
}
if (flags & NDR_OUT) {
- ndr_print_struct(ndr, "out", "winbind_pam_auth_crap");
+ ndr_print_struct(ndr, "out", "winbind_auth");
+ ndr->depth++;
+ ndr_print_ptr(ndr, "rep", r->out.rep);
ndr->depth++;
+ ndr_print_set_switch_value(ndr, r->out.rep, *r->in.level);
+ ndr_print_winbind_auth_rep(ndr, "rep", r->out.rep);
+ ndr->depth--;
ndr_print_winbind_status(ndr, "result", r->out.result);
ndr->depth--;
}
false,
},
{
- "winbind_pam_auth",
- sizeof(struct winbind_pam_auth),
- (ndr_push_flags_fn_t) ndr_push_winbind_pam_auth,
- (ndr_pull_flags_fn_t) ndr_pull_winbind_pam_auth,
- (ndr_print_function_t) ndr_print_winbind_pam_auth,
- false,
- },
- {
- "winbind_pam_auth_crap",
- sizeof(struct winbind_pam_auth_crap),
- (ndr_push_flags_fn_t) ndr_push_winbind_pam_auth_crap,
- (ndr_pull_flags_fn_t) ndr_pull_winbind_pam_auth_crap,
- (ndr_print_function_t) ndr_print_winbind_pam_auth_crap,
+ "winbind_auth",
+ sizeof(struct winbind_auth),
+ (ndr_push_flags_fn_t) ndr_push_winbind_auth,
+ (ndr_pull_flags_fn_t) ndr_pull_winbind_auth,
+ (ndr_print_function_t) ndr_print_winbind_auth,
false,
},
{
NDR_WINBIND_PROTOCOL_VERSION
},
.helpstring = NDR_WINBIND_PROTOCOL_HELPSTRING,
- .num_calls = 37,
+ .num_calls = 36,
.calls = winbind_protocol_calls,
.endpoints = &winbind_protocol_endpoints,
.authservices = &winbind_protocol_authservices