Ignore:
Timestamp:
Jul 2, 2011, 3:35:33 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/librpc/ndr/ndr.c

    r414 r596  
    11061106        }
    11071107        if (!(ndr->flags & LIBNDR_FLAG_RELATIVE_REVERSE)) {
     1108                uint32_t relative_offset;
     1109                size_t pad;
     1110                size_t align = 1;
     1111
     1112                if (ndr->offset < ndr->relative_base_offset) {
     1113                        return ndr_push_error(ndr, NDR_ERR_BUFSIZE,
     1114                                      "ndr_push_relative_ptr2_start ndr->offset(%u) < ndr->relative_base_offset(%u)",
     1115                                      ndr->offset, ndr->relative_base_offset);
     1116                }
     1117
     1118                relative_offset = ndr->offset - ndr->relative_base_offset;
     1119
     1120                if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
     1121                        align = 1;
     1122                } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1123                        align = 2;
     1124                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
     1125                        align = 4;
     1126                } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) {
     1127                        align = 8;
     1128                }
     1129
     1130                pad = ndr_align_size(relative_offset, align);
     1131                if (pad) {
     1132                        NDR_CHECK(ndr_push_zero(ndr, pad));
     1133                }
     1134
    11081135                return ndr_push_relative_ptr2(ndr, p);
    11091136        }
     
    11721199        correct_offset = ndr->relative_end_offset - len;
    11731200
    1174         /* TODO: remove this hack and let the idl use FLAG_ALIGN2 explicit */
    1175         align = 2;
    1176 
    1177         if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1201        if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
     1202                align = 1;
     1203        } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
    11781204                align = 2;
    11791205        } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
Note: See TracChangeset for help on using the changeset viewer.