Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/libcli/raw/rawrequest.c

    r414 r745  
    120120*/
    121121struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *transport,
    122                                                       uint8_t command, uint_t wct, uint_t buflen)
     122                                                      uint8_t command, unsigned int wct, unsigned int buflen)
    123123{
    124124        struct smbcli_request *req;
     
    168168*/
    169169struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session,
    170                                                     uint8_t command, uint_t wct, size_t buflen)
     170                                                    uint8_t command, unsigned int wct, size_t buflen)
    171171{
    172172        struct smbcli_request *req;
     
    191191struct smbcli_request *smbcli_request_setup(struct smbcli_tree *tree,
    192192                                            uint8_t command,
    193                                             uint_t wct, uint_t buflen)
     193                                            unsigned int wct, unsigned int buflen)
    194194{
    195195        struct smbcli_request *req;
     
    212212  point at the same offset into the packet as before this call
    213213*/
    214 static void smbcli_req_grow_allocation(struct smbcli_request *req, uint_t new_size)
     214static void smbcli_req_grow_allocation(struct smbcli_request *req, unsigned int new_size)
    215215{
    216216        int delta;
     
    253253  point at the same offset into the packet as before this call
    254254*/
    255 static void smbcli_req_grow_data(struct smbcli_request *req, uint_t new_size)
     255static void smbcli_req_grow_data(struct smbcli_request *req, unsigned int new_size)
    256256{
    257257        int delta;
     
    275275NTSTATUS smbcli_chained_request_setup(struct smbcli_request *req,
    276276                                      uint8_t command,
    277                                       uint_t wct, size_t buflen)
    278 {
    279         uint_t new_size = 1 + (wct*2) + 2 + buflen;
     277                                      unsigned int wct, size_t buflen)
     278{
     279        unsigned int new_size = 1 + (wct*2) + 2 + buflen;
    280280
    281281        SSVAL(req->out.vwv, VWV(0), command);
     
    372372  an oplock break
    373373*/
    374 bool smbcli_handle_oplock_break(struct smbcli_transport *transport, uint_t len, const uint8_t *hdr, const uint8_t *vwv)
     374bool smbcli_handle_oplock_break(struct smbcli_transport *transport, unsigned int len, const uint8_t *hdr, const uint8_t *vwv)
    375375{
    376376        /* we must be very fussy about what we consider an oplock break to avoid
     
    417417  return the number of bytes added to the packet
    418418*/
    419 size_t smbcli_req_append_string(struct smbcli_request *req, const char *str, uint_t flags)
     419size_t smbcli_req_append_string(struct smbcli_request *req, const char *str, unsigned int flags)
    420420{
    421421        size_t len;
     
    449449 placed in the packet as a separate field 
    450450*/
    451 size_t smbcli_req_append_string_len(struct smbcli_request *req, const char *str, uint_t flags, int *len)
     451size_t smbcli_req_append_string_len(struct smbcli_request *req, const char *str, unsigned int flags, int *len)
    452452{
    453453        int diff = 0;
     
    490490  if dest_len is -1 then no limit applies
    491491*/
    492 size_t smbcli_req_append_ascii4(struct smbcli_request *req, const char *str, uint_t flags)
     492size_t smbcli_req_append_ascii4(struct smbcli_request *req, const char *str, unsigned int flags)
    493493{
    494494        size_t size;
     
    556556*/
    557557static size_t smbcli_req_pull_ucs2(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx,
    558                                 char **dest, const uint8_t *src, int byte_len, uint_t flags)
     558                                char **dest, const uint8_t *src, int byte_len, unsigned int flags)
    559559{
    560560        int src_len, src_len2, alignment=0;
     
    610610*/
    611611size_t smbcli_req_pull_ascii(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx,
    612                              char **dest, const uint8_t *src, int byte_len, uint_t flags)
     612                             char **dest, const uint8_t *src, int byte_len, unsigned int flags)
    613613{
    614614        int src_len, src_len2;
     
    654654*/
    655655size_t smbcli_req_pull_string(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx,
    656                            char **dest, const uint8_t *src, int byte_len, uint_t flags)
     656                           char **dest, const uint8_t *src, int byte_len, unsigned int flags)
    657657{
    658658        if (!(flags & STR_ASCII) &&
     
    752752size_t smbcli_blob_pull_ucs2(TALLOC_CTX* mem_ctx,
    753753                             const DATA_BLOB *blob, const char **dest,
    754                              const uint8_t *src, int byte_len, uint_t flags)
     754                             const uint8_t *src, int byte_len, unsigned int flags)
    755755{
    756756        int src_len, src_len2, alignment=0;
     
    809809static size_t smbcli_blob_pull_ascii(TALLOC_CTX *mem_ctx,
    810810                                     const DATA_BLOB *blob, const char **dest,
    811                                      const uint8_t *src, int byte_len, uint_t flags)
     811                                     const uint8_t *src, int byte_len, unsigned int flags)
    812812{
    813813        int src_len, src_len2;
     
    861861                               struct smb_wire_string *dest,
    862862                               uint16_t len_offset, uint16_t str_offset,
    863                                uint_t flags)
     863                               unsigned int flags)
    864864{
    865865        int extra;
     
    928928                            const char **dest,
    929929                            uint16_t str_offset,
    930                             uint_t flags)
     930                            unsigned int flags)
    931931{
    932932        int extra = 0;
     
    962962size_t smbcli_blob_append_string(struct smbcli_session *session,
    963963                              TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
    964                               const char *str, uint_t flags)
     964                              const char *str, unsigned int flags)
    965965{
    966966        size_t max_len;
     
    992992  bytes long
    993993 */
    994 enum ndr_err_code smbcli_pull_guid(void *base, uint16_t offset,
    995                                    struct GUID *guid)
     994NTSTATUS smbcli_pull_guid(void *base, uint16_t offset,
     995                          struct GUID *guid)
    996996{
    997997        DATA_BLOB blob;
    998         TALLOC_CTX *tmp_ctx = talloc_new(NULL);
    999         enum ndr_err_code ndr_err;
    1000998
    1001999        ZERO_STRUCTP(guid);
     
    10031001        blob.data       = offset + (uint8_t *)base;
    10041002        blob.length     = 16;
    1005         ndr_err = ndr_pull_struct_blob(&blob, tmp_ctx, NULL, guid,
    1006                                        (ndr_pull_flags_fn_t)ndr_pull_GUID);
    1007         talloc_free(tmp_ctx);
    1008         return ndr_err;
     1003
     1004        return GUID_from_ndr_blob(&blob, guid);
    10091005}
    10101006
     
    10121008  push a guid onto the wire. The buffer must hold 16 bytes
    10131009 */
    1014 enum ndr_err_code smbcli_push_guid(void *base, uint16_t offset,
    1015                                    const struct GUID *guid)
     1010NTSTATUS smbcli_push_guid(void *base, uint16_t offset, const struct GUID *guid)
    10161011{
    10171012        TALLOC_CTX *tmp_ctx = talloc_new(NULL);
    1018         enum ndr_err_code ndr_err;
     1013        NTSTATUS status;
    10191014        DATA_BLOB blob;
    1020         ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, NULL,
    1021                                        guid, (ndr_push_flags_fn_t)ndr_push_GUID);
    1022         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err) || blob.length != 16) {
     1015        status = GUID_to_ndr_blob(guid, tmp_ctx, &blob);
     1016        if (!NT_STATUS_IS_OK(status)) {
    10231017                talloc_free(tmp_ctx);
    1024                 return ndr_err;
     1018                return status;
    10251019        }
    10261020        memcpy(offset + (uint8_t *)base, blob.data, blob.length);
    10271021        talloc_free(tmp_ctx);
    1028         return ndr_err;
    1029 }
     1022        return NT_STATUS_OK;
     1023}
Note: See TracChangeset for help on using the changeset viewer.