Changeset 752 for trunk/server/librpc


Ignore:
Timestamp:
Nov 29, 2012, 2:06:31 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9 2nd part

Location:
trunk/server
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/librpc/idl/ntprinting.idl

    r745 r752  
    2727        } ntprinting_form;
    2828
    29         void decode_ntprinting_form(
     29        [public] void decode_ntprinting_form(
    3030                [in] ntprinting_form form
    3131                );
     
    4747        } ntprinting_driver;
    4848
    49         void decode_ntprinting_driver(
     49        [public] void decode_ntprinting_driver(
    5050                [in] ntprinting_driver driver
    5151                );
     
    147147        } ntprinting_printer;
    148148
    149         void decode_ntprinting_printer(
     149        [public] void decode_ntprinting_printer(
    150150                [in] ntprinting_printer printer
    151151                );
  • trunk/server/librpc/idl/samr.idl

    r745 r752  
    14561456        typedef struct {
    14571457                samPwdChangeReason extendedFailureReason;
    1458                 [string,charset(UTF16)] uint16 *filterModuleName;
     1458                lsa_String filterModuleName;
    14591459        } userPwdChangeFailureInformation;
    14601460
  • trunk/server/librpc/idl/security.idl

    r745 r752  
    571571
    572572        /* This is not yet sent over the network, but is simply defined in IDL */
    573         typedef [public] struct {
     573        typedef [public,gensize] struct {
    574574                uint32 num_sids;
    575575                [size_is(num_sids)] dom_sid sids[*];
     
    579579
    580580        /* This is not yet sent over the network, but is simply defined in IDL */
    581         typedef [public] struct {
     581        typedef [public,gensize] struct {
    582582                uid_t uid;
    583583                uid_t gid;
     
    593593                SECINFO_DACL                 = 0x00000004,
    594594                SECINFO_SACL                 = 0x00000008,
     595                SECINFO_LABEL                = 0x00000010,
    595596                SECINFO_UNPROTECTED_SACL     = 0x10000000,
    596597                SECINFO_UNPROTECTED_DACL     = 0x20000000,
  • trunk/server/librpc/idl/spoolss.idl

    r745 r752  
    679679
    680680        typedef [public,gensize] struct {
    681                 [charset(UTF16)] uint16 devicename[MAXDEVICENAME];
     681                [charset(UTF16),to_null] uint16 devicename[MAXDEVICENAME];
    682682                spoolss_DeviceModeSpecVersion specversion;
    683683                uint16 driverversion;
     
    698698                spoolss_DeviceModeTTOption ttoption;
    699699                spoolss_DeviceModeCollate collate;
    700                 [charset(UTF16)] uint16 formname[MAXDEVICENAME];
     700                [charset(UTF16),to_null] uint16 formname[MAXDEVICENAME];
    701701                uint16 logpixels; /* reserved */
    702702                uint32 bitsperpel; /* reserved */
  • trunk/server/librpc/ndr/libndr.h

    r745 r752  
    137137#define LIBNDR_FLAG_ALIGN8       (1<<24)
    138138
    139 #define LIBNDR_ALIGN_FLAGS (LIBNDR_FLAG_ALIGN2|LIBNDR_FLAG_ALIGN4|LIBNDR_FLAG_ALIGN8)
     139#define LIBNDR_ALIGN_FLAGS ( 0        | \
     140                LIBNDR_FLAG_NOALIGN   | \
     141                LIBNDR_FLAG_REMAINING | \
     142                LIBNDR_FLAG_ALIGN2    | \
     143                LIBNDR_FLAG_ALIGN4    | \
     144                LIBNDR_FLAG_ALIGN8    | \
     145                0)
    140146
    141147#define LIBNDR_PRINT_ARRAY_HEX   (1<<25)
     
    569575enum ndr_err_code ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size);
    570576enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
     577enum ndr_err_code ndr_pull_charset_to_null(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
    571578enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, charset_t chset);
    572579
  • trunk/server/librpc/ndr/ndr.c

    r745 r752  
    381381                (*pflags) &= ~LIBNDR_FLAG_NDR64;
    382382        }
    383         if (new_flags & LIBNDR_FLAG_REMAINING) {
     383        if (new_flags & LIBNDR_ALIGN_FLAGS) {
     384                /* Ensure we only have the passed-in
     385                   align flag set in the new_flags,
     386                   remove any old align flag. */
    384387                (*pflags) &= ~LIBNDR_ALIGN_FLAGS;
    385         }
    386         if (new_flags & LIBNDR_ALIGN_FLAGS) {
    387                 (*pflags) &= ~LIBNDR_FLAG_REMAINING;
    388388        }
    389389        if (new_flags & LIBNDR_FLAG_NO_RELATIVE_REVERSE) {
  • trunk/server/librpc/ndr/ndr_basic.c

    r745 r752  
    12141214
    12151215/*
    1216   push a DATA_BLOB onto the wire.
    1217 */
     1216 * Push a DATA_BLOB onto the wire.
     1217 * 1) When called with LIBNDR_FLAG_ALIGN* alignment flags set, push padding
     1218 *    bytes _only_. The length is determined by the alignment required and the
     1219 *    current ndr offset.
     1220 * 2) When called with the LIBNDR_FLAG_REMAINING flag, push the byte array to
     1221 *    the ndr buffer.
     1222 * 3) Otherwise, push a uint32 length _and_ a corresponding byte array to the
     1223 *    ndr buffer.
     1224 */
    12181225_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
    12191226{
    12201227        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
    12211228                /* nothing to do */
    1222         } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
    1223                 if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
    1224                         blob.length = 0;
    1225                 } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1229        } else if (ndr->flags & (LIBNDR_ALIGN_FLAGS & ~LIBNDR_FLAG_NOALIGN)) {
     1230                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
    12261231                        blob.length = NDR_ALIGN(ndr, 2);
    12271232                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
     
    12401245
    12411246/*
    1242   pull a DATA_BLOB from the wire.
    1243 */
     1247 * Pull a DATA_BLOB from the wire.
     1248 * 1) when called with LIBNDR_FLAG_ALIGN* alignment flags set, pull padding
     1249 *    bytes _only_. The length is determined by the alignment required and the
     1250 *    current ndr offset.
     1251 * 2) When called with the LIBNDR_FLAG_REMAINING flag, pull all remaining bytes
     1252 *    from the ndr buffer.
     1253 * 3) Otherwise, pull a uint32 length _and_ a corresponding byte array from the
     1254 *    ndr buffer.
     1255 */
    12441256_PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob)
    12451257{
     
    12481260        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
    12491261                length = ndr->data_size - ndr->offset;
    1250         } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
    1251                 if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
    1252                         length = 0;
    1253                 } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1262        } else if (ndr->flags & (LIBNDR_ALIGN_FLAGS & ~LIBNDR_FLAG_NOALIGN)) {
     1263                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
    12541264                        length = NDR_ALIGN(ndr, 2);
    12551265                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
  • trunk/server/librpc/ndr/ndr_ntprinting.c

    r745 r752  
    5555                                ptr = IVAL(ndr->data, ndr->offset);
    5656                                if (ptr == 0) {
     57                                        ndr->offset = ndr->offset + 4;
    5758                                        break;
    5859                                }
  • trunk/server/librpc/ndr/ndr_string.c

    r745 r752  
    695695}
    696696
     697_PUBLIC_ enum ndr_err_code ndr_pull_charset_to_null(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset)
     698{
     699        size_t converted_size;
     700        uint32_t str_len;
     701
     702        if (length == 0) {
     703                *var = talloc_strdup(ndr->current_mem_ctx, "");
     704                return NDR_ERR_SUCCESS;
     705        }
     706
     707        if (NDR_BE(ndr) && chset == CH_UTF16) {
     708                chset = CH_UTF16BE;
     709        }
     710
     711        NDR_PULL_NEED_BYTES(ndr, length*byte_mul);
     712
     713        str_len = ndr_string_length(ndr->data+ndr->offset, byte_mul);
     714        str_len = MIN(str_len, length); /* overrun protection */
     715
     716        if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX,
     717                                   ndr->data+ndr->offset, str_len*byte_mul,
     718                                   discard_const_p(void *, var),
     719                                   &converted_size, false))
     720        {
     721                return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
     722                                      "Bad character conversion");
     723        }
     724        NDR_CHECK(ndr_pull_advance(ndr, length*byte_mul));
     725
     726        return NDR_ERR_SUCCESS;
     727}
     728
    697729_PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, charset_t chset)
    698730{
Note: See TracChangeset for help on using the changeset viewer.