summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_basic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-17 06:27:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-17 06:27:45 +0000
commit59df3ce5b5c5b484793a0e16faeb581ef343e167 (patch)
treecceb5d9fc8df01ec7c399ef690e86a34fba34a6b /source4/librpc/ndr/ndr_basic.c
parentfa83432e1085d32f1a3f4208b81b6e936ba63b38 (diff)
downloadsamba-59df3ce5b5c5b484793a0e16faeb581ef343e167.tar.gz
samba-59df3ce5b5c5b484793a0e16faeb581ef343e167.tar.bz2
samba-59df3ce5b5c5b484793a0e16faeb581ef343e167.zip
security descriptors are no longer a "special" type, they are handled
using the [relative] property this also fixes level3 of PrinterInfo (a relative secdesc) (This used to be commit d5a15257fdd5f6cfe2706765a7c29f623ec1c6f8)
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r--source4/librpc/ndr/ndr_basic.c46
1 files changed, 41 insertions, 5 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 8e90fc990f..ee03e5aaa2 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -108,8 +108,11 @@ NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char *data, uint32 n)
/*
pull an array of uint8
*/
-NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, char *data, uint32 n)
+NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, char *data, uint32 n)
{
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
return ndr_pull_bytes(ndr, data, n);
}
@@ -117,9 +120,12 @@ NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, char *data, uint32 n)
/*
pull an array of uint16
*/
-NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, uint16 *data, uint32 n)
+NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, int ndr_flags, uint16 *data, uint32 n)
{
uint32 i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
for (i=0;i<n;i++) {
NDR_CHECK(ndr_pull_uint16(ndr, &data[i]));
}
@@ -129,9 +135,12 @@ NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, uint16 *data, uint32 n)
/*
pull a const array of uint32
*/
-NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, uint32 *data, uint32 n)
+NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32 *data, uint32 n)
{
uint32 i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
for (i=0;i<n;i++) {
NDR_CHECK(ndr_pull_uint32(ndr, &data[i]));
}
@@ -224,17 +233,23 @@ NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32 n)
/*
push an array of uint8
*/
-NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, const char *data, uint32 n)
+NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const char *data, uint32 n)
{
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
return ndr_push_bytes(ndr, data, n);
}
/*
push an array of uint32
*/
-NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, const uint32 *data, uint32 n)
+NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32 *data, uint32 n)
{
int i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
for (i=0;i<n;i++) {
NDR_CHECK(ndr_push_uint32(ndr, data[i]));
}
@@ -599,3 +614,24 @@ NTSTATUS ndr_pull_DATA_BLOB(struct ndr_pull *ndr, DATA_BLOB *blob)
ndr->offset += length;
return NT_STATUS_OK;
}
+
+
+/*
+ parse a policy handle
+*/
+NTSTATUS ndr_pull_policy_handle(struct ndr_pull *ndr,
+ struct policy_handle *r)
+{
+ NDR_CHECK(ndr_pull_bytes(ndr, r->data, 20));
+ return NT_STATUS_OK;
+}
+
+/*
+ push a policy handle
+*/
+NTSTATUS ndr_push_policy_handle(struct ndr_push *ndr,
+ struct policy_handle *r)
+{
+ NDR_CHECK(ndr_push_bytes(ndr, r->data, 20));
+ return NT_STATUS_OK;
+}