[SCM] Samba Shared Repository - branch v3-6-test updated
Jeremy Allison
jra at samba.org
Tue Mar 1 10:05:37 MST 2011
The branch, v3-6-test has been updated
via 1ea17ba librpc/ndr: handle NOALIGN flag for relative pointers and alignment DATA_BLOBs
from ba1a72c spoolss.idl: align spoolss_DriverFileInfo relative pointer to 4 byte
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit 1ea17bacdb09d28a12a8b6ddeba3ac285cd9f905
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Mar 1 14:20:32 2011 +0100
librpc/ndr: handle NOALIGN flag for relative pointers and alignment DATA_BLOBs
metze
Autobuild-User: Stefan Metzmacher <metze at samba.org>
Autobuild-Date: Tue Mar 1 17:11:03 CET 2011 on sn-devel-104
(cherry picked from commit ef224aa004d5f1726d8dca020e0ef96d8c58565e)
-----------------------------------------------------------------------
Summary of changes:
librpc/ndr/ndr.c | 8 ++++++--
librpc/ndr/ndr_basic.c | 11 ++++++++---
2 files changed, 14 insertions(+), 5 deletions(-)
Changeset truncated at 500 lines:
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index e7850d3..cfeb231 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -1191,7 +1191,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, co
relative_offset = ndr->offset - ndr->relative_base_offset;
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
+ if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
+ align = 1;
+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
align = 2;
} else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
align = 4;
@@ -1270,7 +1272,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, cons
/* the reversed offset is at the end of the main buffer */
correct_offset = ndr->relative_end_offset - len;
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
+ if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
+ align = 1;
+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
align = 2;
} else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
align = 4;
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index d8e1cf0..9062f7c 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -1158,8 +1158,11 @@ _PUBLIC_ void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_
_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
{
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
+ /* nothing to do */
} else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
+ if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
+ blob.length = 0;
+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
blob.length = NDR_ALIGN(ndr, 2);
} else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
blob.length = NDR_ALIGN(ndr, 4);
@@ -1168,7 +1171,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flag
}
NDR_PUSH_ALLOC_SIZE(ndr, blob.data, blob.length);
data_blob_clear(&blob);
- } else if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
+ } else {
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length));
}
NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length));
@@ -1185,7 +1188,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flag
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
length = ndr->data_size - ndr->offset;
} else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
- if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
+ if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
+ length = 0;
+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
length = NDR_ALIGN(ndr, 2);
} else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
length = NDR_ALIGN(ndr, 4);
--
Samba Shared Repository
More information about the samba-cvs
mailing list