summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_lsa.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-10 12:12:22 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-10 12:12:22 +0000
commit4659d4f9e2bfdbd253ff14e9181dd65023ff6c6a (patch)
tree5306b99dbe6c2cac68b8755c1a21fec127a84068 /source4/librpc/ndr/ndr_lsa.c
parenta9fbdd4838a40b51df592023f5507b3db0923668 (diff)
downloadsamba-4659d4f9e2bfdbd253ff14e9181dd65023ff6c6a.tar.gz
samba-4659d4f9e2bfdbd253ff14e9181dd65023ff6c6a.tar.bz2
samba-4659d4f9e2bfdbd253ff14e9181dd65023ff6c6a.zip
added IDL and test for lsa_EnumAccountRights()
interestingly, win2000 doesn't return the same list of rights via lsa_EnumAccountRights() and lsa_EnumPrivsAccount() (This used to be commit 447c5f13d40d05a49b8bfa1c28c2797371ff5352)
Diffstat (limited to 'source4/librpc/ndr/ndr_lsa.c')
-rw-r--r--source4/librpc/ndr/ndr_lsa.c74
1 files changed, 72 insertions, 2 deletions
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c
index 59d3fc9b7b..1b73482e9c 100644
--- a/source4/librpc/ndr/ndr_lsa.c
+++ b/source4/librpc/ndr/ndr_lsa.c
@@ -1179,14 +1179,84 @@ NTSTATUS ndr_pull_ENUMACCTWITHRIGHT(struct ndr_pull *ndr, struct ENUMACCTWITHRIG
return NT_STATUS_OK;
}
-NTSTATUS ndr_push_ENUMACCTRIGHTS(struct ndr_push *ndr, struct ENUMACCTRIGHTS *r)
+static NTSTATUS ndr_push_lsa_RightAttribute(struct ndr_push *ndr, int ndr_flags, struct lsa_RightAttribute *r)
{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_ptr(ndr, r->name));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->name) {
+ NDR_CHECK(ndr_push_unistr(ndr, r->name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_RightAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightAttribute *r)
+{
+ uint32 _ptr_name;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_name));
+ if (_ptr_name) {
+ NDR_ALLOC(ndr, r->name);
+ } else {
+ r->name = NULL;
+ }
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->name) {
+ NDR_CHECK(ndr_pull_unistr(ndr, &r->name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_push_lsa_RightSet(struct ndr_push *ndr, int ndr_flags, struct lsa_RightSet *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_uint32(ndr, r->count));
+ NDR_CHECK(ndr_push_ptr(ndr, r->names));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->names) {
+ NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->names, sizeof(r->names[0]), r->count, (ndr_push_flags_fn_t)ndr_push_lsa_Name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightSet *r)
+{
+ uint32 _ptr_names;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->count));
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_names));
+ if (_ptr_names) {
+ NDR_ALLOC(ndr, r->names);
+ } else {
+ r->names = NULL;
+ }
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->names) {
+ NDR_ALLOC_N_SIZE(ndr, r->names, r->count, sizeof(r->names[0]));
+ NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->names, sizeof(r->names[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_lsa_Name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+NTSTATUS ndr_push_lsa_EnumAccountRights(struct ndr_push *ndr, struct lsa_EnumAccountRights *r)
+{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
+ NDR_CHECK(ndr_push_dom_sid2(ndr, r->in.sid));
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_ENUMACCTRIGHTS(struct ndr_pull *ndr, struct ENUMACCTRIGHTS *r)
+NTSTATUS ndr_pull_lsa_EnumAccountRights(struct ndr_pull *ndr, struct lsa_EnumAccountRights *r)
{
+ NDR_CHECK(ndr_pull_lsa_RightSet(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rights));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;