Changeset 745 for trunk/server/source4/libcli/raw/rawrequest.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/libcli/raw/rawrequest.c
r414 r745 120 120 */ 121 121 struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *transport, 122 uint8_t command, u int_t wct, uint_t buflen)122 uint8_t command, unsigned int wct, unsigned int buflen) 123 123 { 124 124 struct smbcli_request *req; … … 168 168 */ 169 169 struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session, 170 uint8_t command, u int_t wct, size_t buflen)170 uint8_t command, unsigned int wct, size_t buflen) 171 171 { 172 172 struct smbcli_request *req; … … 191 191 struct smbcli_request *smbcli_request_setup(struct smbcli_tree *tree, 192 192 uint8_t command, 193 u int_t wct, uint_t buflen)193 unsigned int wct, unsigned int buflen) 194 194 { 195 195 struct smbcli_request *req; … … 212 212 point at the same offset into the packet as before this call 213 213 */ 214 static void smbcli_req_grow_allocation(struct smbcli_request *req, u int_t new_size)214 static void smbcli_req_grow_allocation(struct smbcli_request *req, unsigned int new_size) 215 215 { 216 216 int delta; … … 253 253 point at the same offset into the packet as before this call 254 254 */ 255 static void smbcli_req_grow_data(struct smbcli_request *req, u int_t new_size)255 static void smbcli_req_grow_data(struct smbcli_request *req, unsigned int new_size) 256 256 { 257 257 int delta; … … 275 275 NTSTATUS smbcli_chained_request_setup(struct smbcli_request *req, 276 276 uint8_t command, 277 u int_t wct, size_t buflen)278 { 279 u int_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; 280 280 281 281 SSVAL(req->out.vwv, VWV(0), command); … … 372 372 an oplock break 373 373 */ 374 bool smbcli_handle_oplock_break(struct smbcli_transport *transport, u int_t len, const uint8_t *hdr, const uint8_t *vwv)374 bool smbcli_handle_oplock_break(struct smbcli_transport *transport, unsigned int len, const uint8_t *hdr, const uint8_t *vwv) 375 375 { 376 376 /* we must be very fussy about what we consider an oplock break to avoid … … 417 417 return the number of bytes added to the packet 418 418 */ 419 size_t smbcli_req_append_string(struct smbcli_request *req, const char *str, u int_t flags)419 size_t smbcli_req_append_string(struct smbcli_request *req, const char *str, unsigned int flags) 420 420 { 421 421 size_t len; … … 449 449 placed in the packet as a separate field 450 450 */ 451 size_t smbcli_req_append_string_len(struct smbcli_request *req, const char *str, u int_t flags, int *len)451 size_t smbcli_req_append_string_len(struct smbcli_request *req, const char *str, unsigned int flags, int *len) 452 452 { 453 453 int diff = 0; … … 490 490 if dest_len is -1 then no limit applies 491 491 */ 492 size_t smbcli_req_append_ascii4(struct smbcli_request *req, const char *str, u int_t flags)492 size_t smbcli_req_append_ascii4(struct smbcli_request *req, const char *str, unsigned int flags) 493 493 { 494 494 size_t size; … … 556 556 */ 557 557 static size_t smbcli_req_pull_ucs2(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx, 558 char **dest, const uint8_t *src, int byte_len, u int_t flags)558 char **dest, const uint8_t *src, int byte_len, unsigned int flags) 559 559 { 560 560 int src_len, src_len2, alignment=0; … … 610 610 */ 611 611 size_t smbcli_req_pull_ascii(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx, 612 char **dest, const uint8_t *src, int byte_len, u int_t flags)612 char **dest, const uint8_t *src, int byte_len, unsigned int flags) 613 613 { 614 614 int src_len, src_len2; … … 654 654 */ 655 655 size_t smbcli_req_pull_string(struct request_bufinfo *bufinfo, TALLOC_CTX *mem_ctx, 656 char **dest, const uint8_t *src, int byte_len, u int_t flags)656 char **dest, const uint8_t *src, int byte_len, unsigned int flags) 657 657 { 658 658 if (!(flags & STR_ASCII) && … … 752 752 size_t smbcli_blob_pull_ucs2(TALLOC_CTX* mem_ctx, 753 753 const DATA_BLOB *blob, const char **dest, 754 const uint8_t *src, int byte_len, u int_t flags)754 const uint8_t *src, int byte_len, unsigned int flags) 755 755 { 756 756 int src_len, src_len2, alignment=0; … … 809 809 static size_t smbcli_blob_pull_ascii(TALLOC_CTX *mem_ctx, 810 810 const DATA_BLOB *blob, const char **dest, 811 const uint8_t *src, int byte_len, u int_t flags)811 const uint8_t *src, int byte_len, unsigned int flags) 812 812 { 813 813 int src_len, src_len2; … … 861 861 struct smb_wire_string *dest, 862 862 uint16_t len_offset, uint16_t str_offset, 863 u int_t flags)863 unsigned int flags) 864 864 { 865 865 int extra; … … 928 928 const char **dest, 929 929 uint16_t str_offset, 930 u int_t flags)930 unsigned int flags) 931 931 { 932 932 int extra = 0; … … 962 962 size_t smbcli_blob_append_string(struct smbcli_session *session, 963 963 TALLOC_CTX *mem_ctx, DATA_BLOB *blob, 964 const char *str, u int_t flags)964 const char *str, unsigned int flags) 965 965 { 966 966 size_t max_len; … … 992 992 bytes long 993 993 */ 994 enum ndr_err_code smbcli_pull_guid(void *base, uint16_t offset, 995 994 NTSTATUS smbcli_pull_guid(void *base, uint16_t offset, 995 struct GUID *guid) 996 996 { 997 997 DATA_BLOB blob; 998 TALLOC_CTX *tmp_ctx = talloc_new(NULL);999 enum ndr_err_code ndr_err;1000 998 1001 999 ZERO_STRUCTP(guid); … … 1003 1001 blob.data = offset + (uint8_t *)base; 1004 1002 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); 1009 1005 } 1010 1006 … … 1012 1008 push a guid onto the wire. The buffer must hold 16 bytes 1013 1009 */ 1014 enum ndr_err_code smbcli_push_guid(void *base, uint16_t offset, 1015 const struct GUID *guid) 1010 NTSTATUS smbcli_push_guid(void *base, uint16_t offset, const struct GUID *guid) 1016 1011 { 1017 1012 TALLOC_CTX *tmp_ctx = talloc_new(NULL); 1018 enum ndr_err_code ndr_err;1013 NTSTATUS status; 1019 1014 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)) { 1023 1017 talloc_free(tmp_ctx); 1024 return ndr_err;1018 return status; 1025 1019 } 1026 1020 memcpy(offset + (uint8_t *)base, blob.data, blob.length); 1027 1021 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.