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

« back to all changes in this revision

Viewing changes to librpc/ndr/ndr.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:
1105
1105
                return NDR_ERR_SUCCESS;
1106
1106
        }
1107
1107
        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
 
1108
1135
                return ndr_push_relative_ptr2(ndr, p);
1109
1136
        }
1110
1137
        if (ndr->relative_end_offset == -1) {
1171
1198
        /* the reversed offset is at the end of the main buffer */
1172
1199
        correct_offset = ndr->relative_end_offset - len;
1173
1200
 
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) {
1178
1204
                align = 2;
1179
1205
        } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
1180
1206
                align = 4;