~ubuntu-branches/ubuntu/oneiric/samba/oneiric-security

« back to all changes in this revision

Viewing changes to librpc/ndr/ndr_basic.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-03-02 16:05:41 UTC
  • Revision ID: james.westby@ubuntu.com-20110302160541-oi1y7yhqn9qe2phs
Tags: 2:3.5.6~dfsg-5ubuntu3
* debian/patches/fix-windows7-print-connection.patch: Fix
  error "0x000003e6" when trying to connect a Windows 7 printer
  to a domain. (LP: #674216)
* debian/samba-common.dhcp: Take in account of the upstart script.
  (LP: #652065)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1011
1011
*/
1012
1012
_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
1013
1013
{
1014
 
        if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
1015
 
                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
 
1014
        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
 
1015
                /* nothing to do */
 
1016
        } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
 
1017
                if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
 
1018
                        blob.length = 0;
 
1019
                } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
1016
1020
                        blob.length = NDR_ALIGN(ndr, 2);
1017
1021
                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
1018
1022
                        blob.length = NDR_ALIGN(ndr, 4);
1021
1025
                }
1022
1026
                NDR_PUSH_ALLOC_SIZE(ndr, blob.data, blob.length);
1023
1027
                data_blob_clear(&blob);
1024
 
        } else if (!(ndr->flags & LIBNDR_FLAG_REMAINING)) {
 
1028
        } else {
1025
1029
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length));
1026
1030
        }
1027
1031
        NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length));
1035
1039
{
1036
1040
        uint32_t length = 0;
1037
1041
 
1038
 
        if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
1039
 
                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
 
1042
        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
 
1043
                length = ndr->data_size - ndr->offset;
 
1044
        } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
 
1045
                if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
 
1046
                        length = 0;
 
1047
                } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
1040
1048
                        length = NDR_ALIGN(ndr, 2);
1041
1049
                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
1042
1050
                        length = NDR_ALIGN(ndr, 4);
1046
1054
                if (ndr->data_size - ndr->offset < length) {
1047
1055
                        length = ndr->data_size - ndr->offset;
1048
1056
                }
1049
 
        } else if (ndr->flags & LIBNDR_FLAG_REMAINING) {
1050
 
                length = ndr->data_size - ndr->offset;
1051
1057
        } else {
1052
1058
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &length));
1053
1059
        }