s3: use samba4 prototype for ndr_push/pull_struct_blob.
authorGünther Deschner <gd@samba.org>
Tue, 23 Sep 2008 06:09:37 +0000 (08:09 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 23 Sep 2008 07:37:23 +0000 (09:37 +0200)
Guenther

source3/include/proto.h
source3/libads/authdata.c
source3/libads/cldap.c
source3/librpc/ndr/ndr.c
source3/libsmb/dsgetdcname.c
source3/libsmb/samlogon_cache.c
source3/smbd/notify_internal.c
source3/winbindd/winbindd_pam.c

index 194548c0820e10fa7ff257a97973b2b2644fa8b7..ddd3a573f26967faf9cfe3d1ea29dc53bb9cbfb4 100644 (file)
@@ -3960,16 +3960,14 @@ _PUBLIC_ enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, con
 _PUBLIC_ uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p);
 _PUBLIC_ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p);
 _PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
-                             ndr_pull_flags_fn_t fn);
+_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
 _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                                  ndr_pull_flags_fn_t fn);
 _PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                             uint32_t level, ndr_pull_flags_fn_t fn);
 _PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                             uint32_t level, ndr_pull_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p,
-                             ndr_push_flags_fn_t fn);
+_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
 _PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                             uint32_t level, ndr_push_flags_fn_t fn);
 _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
index 0bde3e6984aa0f2dd4f7cfd762bc0c43c6a9af1d..40f051c8510960587a50e7c15197d1c9b75cbd5e 100644 (file)
@@ -108,7 +108,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
        }
 
        ndr_err = ndr_pull_struct_blob(pac_data_blob, pac_data,
-                       pac_data,
+                       NULL, pac_data,
                       (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -124,7 +124,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
        }
 
        ndr_err = ndr_pull_struct_blob(pac_data_blob, pac_data_raw,
-                                      pac_data_raw,
+                                      NULL, pac_data_raw,
                                       (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -205,7 +205,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
 
        /* We find the data blobs above, now we parse them to get at the exact portion we should zero */
        ndr_err = ndr_pull_struct_blob(kdc_sig_blob, kdc_sig_wipe,
-                                      kdc_sig_wipe,
+                                      NULL, kdc_sig_wipe,
                                       (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -215,7 +215,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
        }
 
        ndr_err = ndr_pull_struct_blob(srv_sig_blob, srv_sig_wipe,
-                                      srv_sig_wipe,
+                                      NULL, srv_sig_wipe,
                                       (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -230,7 +230,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
 
        /* and reencode, back into the same place it came from */
        ndr_err = ndr_push_struct_blob(kdc_sig_blob, pac_data_raw,
-                                      kdc_sig_wipe,
+                                      NULL, kdc_sig_wipe,
                                       (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -239,7 +239,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
                return status;
        }
        ndr_err = ndr_push_struct_blob(srv_sig_blob, pac_data_raw,
-                                      srv_sig_wipe,
+                                      NULL, srv_sig_wipe,
                                       (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
@@ -250,7 +250,7 @@ static krb5_error_code check_pac_checksum(TALLOC_CTX *mem_ctx,
 
        /* push out the whole structure, but now with zero'ed signatures */
        ndr_err = ndr_push_struct_blob(&modified_pac_blob, pac_data_raw,
-                                      pac_data_raw,
+                                      NULL, pac_data_raw,
                                       (ndr_push_flags_fn_t)ndr_push_PAC_DATA_RAW);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                status = ndr_map_error2ntstatus(ndr_err);
index 11565065af955886f1242d457a424a8e3a084ee8..73b28b523acc18b79e356176b5cca7eebccdffa5 100644 (file)
@@ -294,7 +294,7 @@ bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx,
        uint32_t nt_version_query = ((*nt_version) & 0x0000001f);
        uint16_t command = 0;
 
-       ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &command,
+       ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &command,
                        (ndr_pull_flags_fn_t)ndr_pull_uint16);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                return false;
index d94d12e1466c0ad66e5f52f20c5b347d880f76f0..624024c94d9a13c8fc5b38ad0c147878843a7f93 100644 (file)
@@ -803,8 +803,11 @@ _PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *
 /*
   pull a struct from a blob using NDR
 */
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
-                             ndr_pull_flags_fn_t fn)
+_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct smb_iconv_convenience *iconv_convenience,
+                                               void *p,
+                                               ndr_pull_flags_fn_t fn)
 {
        struct ndr_pull *ndr;
        ndr = ndr_pull_init_blob(blob, mem_ctx);
@@ -868,8 +871,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC
 /*
   push a struct to a blob using NDR
 */
-_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p,
-                             ndr_push_flags_fn_t fn)
+_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct smb_iconv_convenience *iconv_convenience,
+                                               const void *p,
+                                               ndr_push_flags_fn_t fn)
 {
        struct ndr_push *ndr;
        ndr = ndr_push_init_ctx(mem_ctx);
index 2a445cbd5a7b40cee5da72216ea8cb2e2955c5ff..e82263554605d04360ce6e0f6e2faeebc7c64385 100644 (file)
@@ -331,7 +331,7 @@ static NTSTATUS store_cldap_reply(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &logon29,
+       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, &logon29,
                       (ndr_push_flags_fn_t)ndr_push_nbt_cldap_netlogon_29);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                return ndr_map_error2ntstatus(ndr_err);
@@ -508,7 +508,7 @@ static NTSTATUS dsgetdcname_cache_fetch(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
+       ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, &r,
                      (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon_29);
 
        data_blob_free(&blob);
index 4abe5bb6de2250a0c32b71ba20cdf000805d8d3d..af4986fa9d681d9bb50fd9df2a2b9cdb1c266142 100644 (file)
@@ -141,7 +141,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
                NDR_PRINT_DEBUG(netsamlogoncache_entry, &r);
        }
 
-       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &r,
+       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, &r,
                                       (ndr_push_flags_fn_t)ndr_push_netsamlogoncache_entry);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                DEBUG(0,("netsamlogon_cache_store: failed to push entry to cache\n"));
@@ -197,7 +197,7 @@ struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID *
 
        blob = data_blob_const(data.dptr, data.dsize);
 
-       ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
+       ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, &r,
                                      (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
 
        if (DEBUGLEVEL >= 10) {
index 84b8e1098e77b5aa2efe7c5d23b5c9ef2aa3633b..06da717799b1acb2ff7e4d6d048dff3d0b0f42f4 100644 (file)
@@ -166,7 +166,7 @@ static NTSTATUS notify_load(struct notify_context *notify, struct db_record *rec
        status = NT_STATUS_OK;
        if (blob.length > 0) {
                enum ndr_err_code ndr_err;
-               ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->array,
+               ndr_err = ndr_pull_struct_blob(&blob, notify->array, NULL, notify->array,
                                               (ndr_pull_flags_fn_t)ndr_pull_notify_array);
                if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                        status = ndr_map_error2ntstatus(ndr_err);
@@ -220,7 +220,7 @@ static NTSTATUS notify_save(struct notify_context *notify, struct db_record *rec
        tmp_ctx = talloc_new(notify);
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
 
-       ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->array,
+       ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, NULL, notify->array,
                                      (ndr_push_flags_fn_t)ndr_push_notify_array);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                talloc_free(tmp_ctx);
@@ -258,7 +258,7 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data
                return;
        }
 
-       ndr_err = ndr_pull_struct_blob(data, tmp_ctx, &ev,
+       ndr_err = ndr_pull_struct_blob(data, tmp_ctx, NULL, &ev,
                                       (ndr_pull_flags_fn_t)ndr_pull_notify_event);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                talloc_free(tmp_ctx);
@@ -561,7 +561,7 @@ static NTSTATUS notify_send(struct notify_context *notify, struct notify_entry *
 
        tmp_ctx = talloc_new(notify);
 
-       ndr_err = ndr_push_struct_blob(&data, tmp_ctx, &ev,
+       ndr_err = ndr_push_struct_blob(&data, tmp_ctx, NULL, &ev,
                                       (ndr_push_flags_fn_t)ndr_push_notify_event);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                talloc_free(tmp_ctx);
index d9104ca600577fcade960cb0066596a4d11c0421..9ff3899661859abcdc3970f367dc813b8c16f0aa 100644 (file)
@@ -127,7 +127,7 @@ static NTSTATUS append_info3_as_ndr(TALLOC_CTX *mem_ctx,
        DATA_BLOB blob;
        enum ndr_err_code ndr_err;
 
-       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, info3,
+       ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, info3,
                                       (ndr_push_flags_fn_t)ndr_push_netr_SamInfo3);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
                DEBUG(0,("append_info3_as_ndr: failed to append\n"));