summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_lsa.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-09 11:01:39 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-09 11:01:39 +0000
commit3fa8da4d26d9a880a2a4911a32f222fbc5d2eeaa (patch)
tree54e52cd01f56691ba2a0d102e88ffd9bbfa3b96d /source4/librpc/ndr/ndr_lsa.c
parent3c669340f529c559bff88168c3f9ddac9790d6c3 (diff)
downloadsamba-3fa8da4d26d9a880a2a4911a32f222fbc5d2eeaa.tar.gz
samba-3fa8da4d26d9a880a2a4911a32f222fbc5d2eeaa.tar.bz2
samba-3fa8da4d26d9a880a2a4911a32f222fbc5d2eeaa.zip
- fixed lsa_EnumTrustDom
- added lsa_OpenAccount - handle STATUS_SOME_UNMAPPED (This used to be commit e5d93cf996b3e9647ef0ca45f6aab7601369936b)
Diffstat (limited to 'source4/librpc/ndr/ndr_lsa.c')
-rw-r--r--source4/librpc/ndr/ndr_lsa.c108
1 files changed, 87 insertions, 21 deletions
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c
index c3ad9ab26f..37850fbf19 100644
--- a/source4/librpc/ndr/ndr_lsa.c
+++ b/source4/librpc/ndr/ndr_lsa.c
@@ -11,6 +11,7 @@ NTSTATUS ndr_push_lsa_Close(struct ndr_push *ndr, struct lsa_Close *r)
NTSTATUS ndr_pull_lsa_Close(struct ndr_pull *ndr, struct lsa_Close *r)
{
+ NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.handle));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
@@ -486,7 +487,7 @@ NTSTATUS ndr_pull_lsa_CreateTrustDom(struct ndr_pull *ndr, struct lsa_CreateTrus
return NT_STATUS_OK;
}
-static NTSTATUS ndr_push_lsa_TrustInformation(struct ndr_push *ndr, int ndr_flags, struct lsa_TrustInformation *r)
+static NTSTATUS ndr_push_lsa_DomainInformation(struct ndr_push *ndr, int ndr_flags, struct lsa_DomainInformation *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_lsa_Name(ndr, NDR_SCALARS, &r->name));
@@ -501,7 +502,7 @@ done:
return NT_STATUS_OK;
}
-static NTSTATUS ndr_pull_lsa_TrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustInformation *r)
+static NTSTATUS ndr_pull_lsa_DomainInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInformation *r)
{
uint32 _ptr_sid;
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
@@ -522,22 +523,21 @@ done:
return NT_STATUS_OK;
}
-static NTSTATUS ndr_push_lsa_RefDomainList(struct ndr_push *ndr, int ndr_flags, struct lsa_RefDomainList *r)
+static NTSTATUS ndr_push_lsa_DomainList(struct ndr_push *ndr, int ndr_flags, struct lsa_DomainList *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_uint32(ndr, r->count));
NDR_CHECK(ndr_push_ptr(ndr, r->domains));
- NDR_CHECK(ndr_push_uint32(ndr, r->max_count));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->domains) {
- NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->domains, sizeof(r->domains[0]), r->count, (ndr_push_flags_fn_t)ndr_push_lsa_TrustInformation));
+ NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->domains, sizeof(r->domains[0]), r->count, (ndr_push_flags_fn_t)ndr_push_lsa_DomainInformation));
}
done:
return NT_STATUS_OK;
}
-static NTSTATUS ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r)
+static NTSTATUS ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r)
{
uint32 _ptr_domains;
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
@@ -548,12 +548,11 @@ static NTSTATUS ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags,
} else {
r->domains = NULL;
}
- NDR_CHECK(ndr_pull_uint32(ndr, &r->max_count));
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->domains) {
NDR_ALLOC_N_SIZE(ndr, r->domains, r->count, sizeof(r->domains[0]));
- NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->domains, sizeof(r->domains[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustInformation));
+ NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->domains, sizeof(r->domains[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_lsa_DomainInformation));
}
done:
return NT_STATUS_OK;
@@ -570,18 +569,8 @@ NTSTATUS ndr_push_lsa_EnumTrustDom(struct ndr_push *ndr, struct lsa_EnumTrustDom
NTSTATUS ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, struct lsa_EnumTrustDom *r)
{
- uint32 _ptr_domains;
NDR_CHECK(ndr_pull_uint32(ndr, r->out.resume_handle));
- NDR_ALLOC(ndr, r->out.domains);
- NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_domains));
- if (_ptr_domains) {
- NDR_ALLOC(ndr, r->out.domains);
- } else {
- r->out.domains = NULL;
- }
- if (r->out.domains) {
- NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains));
- }
+ NDR_CHECK(ndr_pull_lsa_DomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
@@ -646,6 +635,79 @@ done:
return NT_STATUS_OK;
}
+static NTSTATUS ndr_push_lsa_TrustInformation(struct ndr_push *ndr, int ndr_flags, struct lsa_TrustInformation *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_lsa_Name(ndr, NDR_SCALARS, &r->name));
+ NDR_CHECK(ndr_push_ptr(ndr, r->sid));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ NDR_CHECK(ndr_push_lsa_Name(ndr, ndr_flags, &r->name));
+ if (r->sid) {
+ NDR_CHECK(ndr_push_dom_sid2(ndr, r->sid));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_TrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustInformation *r)
+{
+ uint32 _ptr_sid;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name));
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid));
+ if (_ptr_sid) {
+ NDR_ALLOC(ndr, r->sid);
+ } else {
+ r->sid = NULL;
+ }
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name));
+ if (r->sid) {
+ NDR_CHECK(ndr_pull_dom_sid2(ndr, r->sid));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_push_lsa_RefDomainList(struct ndr_push *ndr, int ndr_flags, struct lsa_RefDomainList *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_uint32(ndr, r->count));
+ NDR_CHECK(ndr_push_ptr(ndr, r->domains));
+ NDR_CHECK(ndr_push_uint32(ndr, r->max_count));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->domains) {
+ NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->domains, sizeof(r->domains[0]), r->count, (ndr_push_flags_fn_t)ndr_push_lsa_TrustInformation));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r)
+{
+ uint32 _ptr_domains;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->count));
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_domains));
+ if (_ptr_domains) {
+ NDR_ALLOC(ndr, r->domains);
+ } else {
+ r->domains = NULL;
+ }
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->max_count));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->domains) {
+ NDR_ALLOC_N_SIZE(ndr, r->domains, r->count, sizeof(r->domains[0]));
+ NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->domains, sizeof(r->domains[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustInformation));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, struct lsa_LookupNames *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
@@ -786,14 +848,18 @@ NTSTATUS ndr_pull_CREATESECRET(struct ndr_pull *ndr, struct CREATESECRET *r)
return NT_STATUS_OK;
}
-NTSTATUS ndr_push_OPENACCOUNT(struct ndr_push *ndr, struct OPENACCOUNT *r)
+NTSTATUS ndr_push_lsa_OpenAccount(struct ndr_push *ndr, struct lsa_OpenAccount *r)
{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
+ NDR_CHECK(ndr_push_dom_sid2(ndr, r->in.sid));
+ NDR_CHECK(ndr_push_uint32(ndr, r->in.desired_access));
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_OPENACCOUNT(struct ndr_pull *ndr, struct OPENACCOUNT *r)
+NTSTATUS ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, struct lsa_OpenAccount *r)
{
+ NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.acct_handle));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;