diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-19 05:53:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-19 05:53:05 +0000 |
commit | 6786811f65f271b220fc5f8ac8d4a85a03ee6d90 (patch) | |
tree | a40376d3df715aaf5dce5ed5d22603256c39db84 | |
parent | a0cd1069ce4edf69d31b88f5082d940ee4d47f2c (diff) | |
download | samba-6786811f65f271b220fc5f8ac8d4a85a03ee6d90.tar.gz samba-6786811f65f271b220fc5f8ac8d4a85a03ee6d90.tar.bz2 samba-6786811f65f271b220fc5f8ac8d4a85a03ee6d90.zip |
change to AuditEventsInfo struct from lukeh
(This used to be commit 670c0cbe034e1e2ac5aed751b6c4fbd925fe3221)
-rw-r--r-- | source4/librpc/idl/lsa.idl | 5 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.c | 39 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.h | 5 |
3 files changed, 16 insertions, 33 deletions
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl index 3628fcb8cc..26da264d6e 100644 --- a/source4/librpc/idl/lsa.idl +++ b/source4/librpc/idl/lsa.idl @@ -118,13 +118,12 @@ typedef struct { - uint32 count; - [size_is(count)] uint32 settings[*]; } lsa_AuditSettings; typedef struct { uint32 auditing_mode; - lsa_AuditSettings *settings; + [size_is(count)] uint32 *settings; + uint32 count; } lsa_AuditEventsInfo; typedef struct { diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c index f40fbcf0f5..f0f00f4e91 100644 --- a/source4/librpc/ndr/ndr_lsa.c +++ b/source4/librpc/ndr/ndr_lsa.c @@ -688,26 +688,6 @@ done: return NT_STATUS_OK; } -NTSTATUS ndr_pull_lsa_AuditSettings(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditSettings *r) -{ - uint32 _conformant_size; - NDR_CHECK(ndr_pull_struct_start(ndr)); - NDR_CHECK(ndr_pull_uint32(ndr, &_conformant_size)); - if (!(ndr_flags & NDR_SCALARS)) goto buffers; - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); - ndr_pull_struct_end(ndr); -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->count > _conformant_size) { - return ndr_pull_error(ndr, NDR_ERR_CONFORMANT_SIZE, "Bad conformant size %u should be %u", _conformant_size, r->count); - } - NDR_ALLOC_N_SIZE(ndr, r->settings, _conformant_size, sizeof(r->settings[0])); - NDR_CHECK(ndr_pull_array_uint32(ndr, NDR_SCALARS|NDR_BUFFERS, r->settings, r->count)); -done: - return NT_STATUS_OK; -} - NTSTATUS ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r) { uint32 _ptr_settings; @@ -721,11 +701,20 @@ NTSTATUS ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struc } else { r->settings = NULL; } + NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); ndr_pull_struct_end(ndr); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; if (r->settings) { - NDR_CHECK(ndr_pull_lsa_AuditSettings(ndr, NDR_SCALARS|NDR_BUFFERS, r->settings)); + { + uint32 _array_size; + NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); + if (r->count > _array_size) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); + } + } + NDR_ALLOC_N_SIZE(ndr, r->settings, r->count, sizeof(r->settings[0])); + NDR_CHECK(ndr_pull_array_uint32(ndr, NDR_SCALARS|NDR_BUFFERS, r->settings, r->count)); } done: return NT_STATUS_OK; @@ -1981,11 +1970,6 @@ void ndr_print_lsa_AuditSettings(struct ndr_print *ndr, const char *name, struct { ndr_print_struct(ndr, name, "lsa_AuditSettings"); ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "settings", r->settings); - ndr->depth++; - ndr_print_array_uint32(ndr, "settings", r->settings, r->count); - ndr->depth--; ndr->depth--; } @@ -1997,9 +1981,10 @@ void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, stru ndr_print_ptr(ndr, "settings", r->settings); ndr->depth++; if (r->settings) { - ndr_print_lsa_AuditSettings(ndr, "settings", r->settings); + ndr_print_array_uint32(ndr, "settings", r->settings, r->count); } ndr->depth--; + ndr_print_uint32(ndr, "count", r->count); ndr->depth--; } diff --git a/source4/librpc/ndr/ndr_lsa.h b/source4/librpc/ndr/ndr_lsa.h index 151e5b9585..5efca8b8ac 100644 --- a/source4/librpc/ndr/ndr_lsa.h +++ b/source4/librpc/ndr/ndr_lsa.h @@ -187,13 +187,12 @@ struct lsa_AuditLogInfo { }; struct lsa_AuditSettings { - uint32 count; - uint32 *settings; }; struct lsa_AuditEventsInfo { uint32 auditing_mode; - struct lsa_AuditSettings *settings; + uint32 *settings; + uint32 count; }; struct lsa_DomainInfo { |