Changeset 740 for vendor/current/source4/libcli/raw
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/source4/libcli/raw
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/libcli/raw/clisocket.c
r414 r740 81 81 state->socket_options = talloc_reference(state, socket_options); 82 82 83 if (!host_addr) { 84 host_addr = host_name; 85 } 86 83 87 ctx = socket_connect_multi_send(state, host_addr, 84 88 state->num_ports, state->ports, -
vendor/current/source4/libcli/raw/clitransport.c
r414 r740 76 76 TALLOC_CTX *parent_ctx, 77 77 bool primary, 78 struct smbcli_options *options, 79 struct smb_iconv_convenience *iconv_convenience) 78 struct smbcli_options *options) 80 79 { 81 80 struct smbcli_transport *transport; … … 92 91 transport->options = *options; 93 92 transport->negotiate.max_xmit = transport->options.max_xmit; 94 transport->iconv_convenience = iconv_convenience;95 93 96 94 /* setup the stream -> packet parser */ … … 173 171 if (!NT_STATUS_IS_OK(status)) goto failed; 174 172 175 status = nbt_name_to_blob(tmp_ctx, transport->iconv_convenience,&calling_blob, calling);173 status = nbt_name_to_blob(tmp_ctx, &calling_blob, calling); 176 174 if (!NT_STATUS_IS_OK(status)) goto failed; 177 175 178 status = nbt_name_to_blob(tmp_ctx, transport->iconv_convenience,&called_blob, called);176 status = nbt_name_to_blob(tmp_ctx, &called_blob, called); 179 177 if (!NT_STATUS_IS_OK(status)) goto failed; 180 178 -
vendor/current/source4/libcli/raw/clitree.c
r414 r740 180 180 struct smbcli_options *options, 181 181 struct smbcli_session_options *session_options, 182 struct smb_iconv_convenience *iconv_convenience,183 182 struct gensec_settings *gensec_settings) 184 183 { … … 206 205 io.in.options = *options; 207 206 io.in.session_options = *session_options; 208 io.in.iconv_convenience = iconv_convenience;209 207 210 208 status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev); -
vendor/current/source4/libcli/raw/interfaces.h
r414 r740 186 186 struct { 187 187 const char *path; 188 u int_t num_eas;188 unsigned int num_eas; 189 189 struct ea_struct *eas; 190 190 } in; … … 489 489 uint32_t attrib; 490 490 uint32_t ea_size; 491 u int_t num_eas;491 unsigned int num_eas; 492 492 struct ea_struct { 493 493 uint8_t flags; … … 517 517 uint32_t alignment_requirement; 518 518 uint32_t reparse_tag; 519 u int_t num_streams;519 unsigned int num_streams; 520 520 struct stream_struct { 521 521 uint64_t size; … … 579 579 struct { 580 580 union smb_handle_or_path file; 581 u int_t num_names;581 unsigned int num_names; 582 582 struct ea_name { 583 583 struct smb_wire_string name; … … 586 586 587 587 struct smb_ea_list { 588 u int_t num_eas;588 unsigned int num_eas; 589 589 struct ea_struct *eas; 590 590 } out; … … 733 733 } in; 734 734 struct stream_information { 735 u int_t num_streams;735 unsigned int num_streams; 736 736 struct stream_struct *streams; 737 737 } out; … … 994 994 struct { 995 995 union smb_handle_or_path file; 996 u int_t num_eas;996 unsigned int num_eas; 997 997 struct ea_struct *eas; 998 998 } in; … … 1357 1357 RAW_OPEN_NTTRANS_CREATE, 1358 1358 RAW_OPEN_OPENX_READX, 1359 RAW_OPEN_NTCREATEX_READX, 1359 1360 RAW_OPEN_SMB2 1360 1361 }; … … 1401 1402 file = &op->openxreadx.out.file; \ 1402 1403 break; \ 1404 case RAW_OPEN_NTCREATEX_READX: \ 1405 file = &op->ntcreatexreadx.out.file; \ 1406 break; \ 1403 1407 case RAW_OPEN_SMB2: \ 1404 1408 file = &op->smb2.out.file; \ … … 1415 1419 struct { 1416 1420 uint32_t flags; 1417 u int32_troot_fid;1421 union smb_handle root_fid; 1418 1422 uint32_t access_mask; 1419 1423 uint64_t alloc_size; … … 1436 1440 /* some optional parameters from the SMB2 varient */ 1437 1441 bool query_maximal_access; 1442 1443 /* private flags for internal use only */ 1444 uint8_t private_flags; 1438 1445 } in; 1439 1446 struct { … … 1471 1478 uint32_t timeout; 1472 1479 const char *fname; 1473 u int_t num_eas;1480 unsigned int num_eas; 1474 1481 struct ea_struct *eas; 1475 1482 } in; … … 1620 1627 } openxreadx; 1621 1628 1629 /* chained NTCreateX/ReadX interface */ 1630 struct { 1631 enum smb_open_level level; 1632 struct { 1633 uint32_t flags; 1634 union smb_handle root_fid; 1635 uint32_t access_mask; 1636 uint64_t alloc_size; 1637 uint32_t file_attr; 1638 uint32_t share_access; 1639 uint32_t open_disposition; 1640 uint32_t create_options; 1641 uint32_t impersonation; 1642 uint8_t security_flags; 1643 /* NOTE: fname can also be a pointer to a 1644 uint64_t file_id if create_options has the 1645 NTCREATEX_OPTIONS_OPEN_BY_FILE_ID flag set */ 1646 const char *fname; 1647 1648 /* readx part */ 1649 uint64_t offset; 1650 uint16_t mincnt; 1651 uint32_t maxcnt; 1652 uint16_t remaining; 1653 } in; 1654 struct { 1655 union smb_handle file; 1656 uint8_t oplock_level; 1657 uint32_t create_action; 1658 NTTIME create_time; 1659 NTTIME access_time; 1660 NTTIME write_time; 1661 NTTIME change_time; 1662 uint32_t attrib; 1663 uint64_t alloc_size; 1664 uint64_t size; 1665 uint16_t file_type; 1666 uint16_t ipc_state; 1667 uint8_t is_directory; 1668 1669 /* readx part */ 1670 uint8_t *data; 1671 uint16_t remaining; 1672 uint16_t compaction_mode; 1673 uint16_t nread; 1674 } out; 1675 } ntcreatexreadx; 1676 1622 1677 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100 1623 1678 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800 … … 1979 2034 /* uint16_t buffer_code; 0x30 */ 1980 2035 uint16_t lock_count; 1981 uint32_t reserved;2036 uint32_t lock_sequence; 1982 2037 /* struct smb2_handle handle; */ 1983 2038 struct smb2_lock_element { … … 2036 2091 union smb_handle file; 2037 2092 time_t write_time; 2038 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)2039 2093 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */ 2040 2094 } in; … … 2433 2487 2434 2488 /* the ea names are only used for RAW_SEARCH_EA_LIST */ 2435 u int_t num_names;2489 unsigned int num_names; 2436 2490 struct ea_name *ea_names; 2437 2491 } in; … … 2517 2571 2518 2572 /* the ea names are only used for RAW_SEARCH_EA_LIST */ 2519 u int_t num_names;2573 unsigned int num_names; 2520 2574 struct ea_name *ea_names; 2521 2575 } in; -
vendor/current/source4/libcli/raw/libcliraw.h
r414 r740 64 64 int server_zone; 65 65 time_t server_time; 66 uint_t readbraw_supported:1; 67 uint_t writebraw_supported:1; 66 unsigned int readbraw_supported:1; 67 unsigned int writebraw_supported:1; 68 unsigned int lockread_supported:1; 68 69 69 70 char *server_domain; … … 93 94 */ 94 95 struct smbcli_options { 95 u int_t use_oplocks:1;96 u int_t use_level2_oplocks:1;97 u int_t use_spnego:1;98 u int_t unicode:1;99 u int_t ntstatus_support:1;96 unsigned int use_oplocks:1; 97 unsigned int use_level2_oplocks:1; 98 unsigned int use_spnego:1; 99 unsigned int unicode:1; 100 unsigned int ntstatus_support:1; 100 101 int max_protocol; 101 102 uint32_t max_xmit; … … 122 123 /* is a readbraw pending? we need to handle that case 123 124 specially on receiving packets */ 124 u int_t readbraw_pending:1;125 unsigned int readbraw_pending:1; 125 126 126 127 /* an idle function - if this is defined then it will be … … 130 131 void (*func)(struct smbcli_transport *, void *); 131 132 void *private_data; 132 u int_t period;133 unsigned int period; 133 134 } idle; 134 135 … … 143 144 SOCKET_WRITE_ERROR, 144 145 SOCKET_READ_BAD_SIG} socket_error; 145 u int_t nbt_error;146 unsigned int nbt_error; 146 147 } e; 147 148 } error; … … 164 165 /* context of the stream -> packet parser */ 165 166 struct packet_context *packet; 166 167 /* iconv convenience */168 struct smb_iconv_convenience *iconv_convenience;169 167 }; 170 168 … … 193 191 194 192 struct smbcli_session_options { 195 u int_t lanman_auth:1;196 u int_t ntlmv2_auth:1;197 u int_t plaintext_auth:1;193 unsigned int lanman_auth:1; 194 unsigned int ntlmv2_auth:1; 195 unsigned int plaintext_auth:1; 198 196 } options; 199 197 … … 256 254 257 255 /* the sequence number of this packet - used for signing */ 258 u int_t seq_num;256 unsigned int seq_num; 259 257 260 258 /* list of ntcancel request for this requests */ … … 263 261 /* set if this is a one-way request, meaning we are not 264 262 expecting a reply from the server. */ 265 u int_t one_way_request:1;263 unsigned int one_way_request:1; 266 264 267 265 /* set this when the request should only increment the signing 268 266 counter by one */ 269 u int_t sign_single_increment:1;267 unsigned int sign_single_increment:1; 270 268 271 269 /* the caller wants to do the signing check */ -
vendor/current/source4/libcli/raw/rawacl.c
r414 r740 78 78 nt.out.data.length = IVAL(nt.out.params.data, 0); 79 79 80 ndr = ndr_pull_init_blob(&nt.out.data, mem_ctx , NULL);80 ndr = ndr_pull_init_blob(&nt.out.data, mem_ctx); 81 81 if (!ndr) { 82 82 return NT_STATUS_INVALID_PARAMETER; … … 136 136 nt.in.params.length = 8; 137 137 138 ndr = ndr_push_init_ctx(NULL , NULL);138 ndr = ndr_push_init_ctx(NULL); 139 139 if (!ndr) return NULL; 140 140 -
vendor/current/source4/libcli/raw/raweas.c
r414 r740 27 27 reasonable assumption 28 28 */ 29 size_t ea_list_size(u int_t num_eas, struct ea_struct *eas)30 { 31 u int_t total = 4;29 size_t ea_list_size(unsigned int num_eas, struct ea_struct *eas) 30 { 31 unsigned int total = 4; 32 32 int i; 33 33 for (i=0;i<num_eas;i++) { … … 40 40 work out how many bytes on the wire a ea name list will consume. 41 41 */ 42 static u int_t ea_name_list_size(uint_t num_names, struct ea_name *eas)43 { 44 u int_t total = 4;42 static unsigned int ea_name_list_size(unsigned int num_names, struct ea_name *eas) 43 { 44 unsigned int total = 4; 45 45 int i; 46 46 for (i=0;i<num_names;i++) { … … 55 55 reasonable assumption 56 56 */ 57 size_t ea_list_size_chained(u int_t num_eas, struct ea_struct *eas, unsigned alignment)58 { 59 u int_t total = 0;57 size_t ea_list_size_chained(unsigned int num_eas, struct ea_struct *eas, unsigned alignment) 58 { 59 unsigned int total = 0; 60 60 int i; 61 61 for (i=0;i<num_eas;i++) { 62 u int_t len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length;62 unsigned int len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length; 63 63 len = (len + (alignment-1)) & ~(alignment-1); 64 64 total += len; … … 71 71 of size ea_list_size() 72 72 */ 73 void ea_put_list(uint8_t *data, u int_t num_eas, struct ea_struct *eas)73 void ea_put_list(uint8_t *data, unsigned int num_eas, struct ea_struct *eas) 74 74 { 75 75 int i; … … 82 82 83 83 for (i=0;i<num_eas;i++) { 84 u int_t nlen = strlen(eas[i].name.s);84 unsigned int nlen = strlen(eas[i].name.s); 85 85 SCVAL(data, 0, eas[i].flags); 86 86 SCVAL(data, 1, nlen); … … 97 97 at least of size ea_list_size() 98 98 */ 99 void ea_put_list_chained(uint8_t *data, u int_t num_eas, struct ea_struct *eas,99 void ea_put_list_chained(uint8_t *data, unsigned int num_eas, struct ea_struct *eas, 100 100 unsigned alignment) 101 101 { … … 103 103 104 104 for (i=0;i<num_eas;i++) { 105 u int_t nlen = strlen(eas[i].name.s);105 unsigned int nlen = strlen(eas[i].name.s); 106 106 uint32_t len = 8+nlen+1+eas[i].value.length; 107 u int_t pad = ((len + (alignment-1)) & ~(alignment-1)) - len;107 unsigned int pad = ((len + (alignment-1)) & ~(alignment-1)) - len; 108 108 if (i == num_eas-1) { 109 109 SIVAL(data, 0, 0); … … 125 125 pull a ea_struct from a buffer. Return the number of bytes consumed 126 126 */ 127 u int_t ea_pull_struct(const DATA_BLOB *blob,127 unsigned int ea_pull_struct(const DATA_BLOB *blob, 128 128 TALLOC_CTX *mem_ctx, 129 129 struct ea_struct *ea) … … 165 165 NTSTATUS ea_pull_list(const DATA_BLOB *blob, 166 166 TALLOC_CTX *mem_ctx, 167 u int_t *num_eas, struct ea_struct **eas)167 unsigned int *num_eas, struct ea_struct **eas) 168 168 { 169 169 int n; … … 185 185 186 186 while (ofs < ea_size) { 187 u int_t len;187 unsigned int len; 188 188 DATA_BLOB blob2; 189 189 … … 214 214 NTSTATUS ea_pull_list_chained(const DATA_BLOB *blob, 215 215 TALLOC_CTX *mem_ctx, 216 u int_t *num_eas, struct ea_struct **eas)216 unsigned int *num_eas, struct ea_struct **eas) 217 217 { 218 218 int n; … … 229 229 230 230 while (ofs < blob->length) { 231 u int_t len;231 unsigned int len; 232 232 DATA_BLOB blob2; 233 233 uint32_t next_ofs = IVAL(blob->data, ofs); … … 262 262 pull a ea_name from a buffer. Return the number of bytes consumed 263 263 */ 264 static u int_t ea_pull_name(const DATA_BLOB *blob,264 static unsigned int ea_pull_name(const DATA_BLOB *blob, 265 265 TALLOC_CTX *mem_ctx, 266 266 struct ea_name *ea) … … 290 290 NTSTATUS ea_pull_name_list(const DATA_BLOB *blob, 291 291 TALLOC_CTX *mem_ctx, 292 u int_t *num_names, struct ea_name **ea_names)292 unsigned int *num_names, struct ea_name **ea_names) 293 293 { 294 294 int n; … … 310 310 311 311 while (ofs < ea_size) { 312 u int_t len;312 unsigned int len; 313 313 DATA_BLOB blob2; 314 314 … … 338 338 */ 339 339 bool ea_push_name_list(TALLOC_CTX *mem_ctx, 340 DATA_BLOB *data, u int_t num_names, struct ea_name *eas)340 DATA_BLOB *data, unsigned int num_names, struct ea_name *eas) 341 341 { 342 342 int i; … … 355 355 356 356 for (i=0;i<num_names;i++) { 357 u int_t nlen = strlen(eas[i].name.s);357 unsigned int nlen = strlen(eas[i].name.s); 358 358 SCVAL(data->data, off, nlen); 359 359 memcpy(data->data+off+1, eas[i].name.s, nlen+1); -
vendor/current/source4/libcli/raw/rawfile.c
r414 r740 349 349 if (parms->ntcreatex.in.sec_desc) { 350 350 enum ndr_err_code ndr_err; 351 ndr_err = ndr_push_struct_blob(&sd_blob, mem_ctx, NULL,351 ndr_err = ndr_push_struct_blob(&sd_blob, mem_ctx, 352 352 parms->ntcreatex.in.sec_desc, 353 353 (ndr_push_flags_fn_t)ndr_push_security_descriptor); … … 380 380 381 381 SIVAL(params, 0, parms->ntcreatex.in.flags); 382 SIVAL(params, 4, parms->ntcreatex.in.root_fid );382 SIVAL(params, 4, parms->ntcreatex.in.root_fid.fnum); 383 383 SIVAL(params, 8, parms->ntcreatex.in.access_mask); 384 384 SBVAL(params, 12, parms->ntcreatex.in.alloc_size); … … 565 565 SCVAL(req->out.vwv, VWV(2),0); /* padding */ 566 566 SIVAL(req->out.vwv, 7, parms->ntcreatex.in.flags); 567 SIVAL(req->out.vwv, 11, parms->ntcreatex.in.root_fid );567 SIVAL(req->out.vwv, 11, parms->ntcreatex.in.root_fid.fnum); 568 568 SIVAL(req->out.vwv, 15, parms->ntcreatex.in.access_mask); 569 569 SBVAL(req->out.vwv, 19, parms->ntcreatex.in.alloc_size); … … 617 617 } 618 618 break; 619 620 case RAW_OPEN_NTCREATEX_READX: 621 SETUP_REQUEST(SMBntcreateX, 24, 0); 622 SSVAL(req->out.vwv, VWV(0),SMB_CHAIN_NONE); 623 SSVAL(req->out.vwv, VWV(1),0); 624 SCVAL(req->out.vwv, VWV(2),0); /* padding */ 625 SIVAL(req->out.vwv, 7, parms->ntcreatexreadx.in.flags); 626 SIVAL(req->out.vwv, 11, parms->ntcreatexreadx.in.root_fid.fnum); 627 SIVAL(req->out.vwv, 15, parms->ntcreatexreadx.in.access_mask); 628 SBVAL(req->out.vwv, 19, parms->ntcreatexreadx.in.alloc_size); 629 SIVAL(req->out.vwv, 27, parms->ntcreatexreadx.in.file_attr); 630 SIVAL(req->out.vwv, 31, parms->ntcreatexreadx.in.share_access); 631 SIVAL(req->out.vwv, 35, parms->ntcreatexreadx.in.open_disposition); 632 SIVAL(req->out.vwv, 39, parms->ntcreatexreadx.in.create_options); 633 SIVAL(req->out.vwv, 43, parms->ntcreatexreadx.in.impersonation); 634 SCVAL(req->out.vwv, 47, parms->ntcreatexreadx.in.security_flags); 635 636 smbcli_req_append_string_len(req, parms->ntcreatexreadx.in.fname, STR_TERMINATE, &len); 637 SSVAL(req->out.vwv, 5, len); 638 639 if (tree->session->transport->negotiate.capabilities & CAP_LARGE_FILES) { 640 bigoffset = true; 641 } 642 643 smbcli_chained_request_setup(req, SMBreadX, bigoffset ? 12 : 10, 0); 644 645 SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE); 646 SSVAL(req->out.vwv, VWV(1), 0); 647 SSVAL(req->out.vwv, VWV(2), 0); 648 SIVAL(req->out.vwv, VWV(3), parms->ntcreatexreadx.in.offset); 649 SSVAL(req->out.vwv, VWV(5), parms->ntcreatexreadx.in.maxcnt & 0xFFFF); 650 SSVAL(req->out.vwv, VWV(6), parms->ntcreatexreadx.in.mincnt); 651 SIVAL(req->out.vwv, VWV(7), parms->ntcreatexreadx.in.maxcnt >> 16); 652 SSVAL(req->out.vwv, VWV(9), parms->ntcreatexreadx.in.remaining); 653 if (bigoffset) { 654 SIVAL(req->out.vwv, VWV(10),parms->ntcreatexreadx.in.offset>>32); 655 } 656 break; 657 619 658 case RAW_OPEN_SMB2: 620 659 return NULL; … … 754 793 } 755 794 break; 795 796 case RAW_OPEN_NTCREATEX_READX: 797 SMBCLI_CHECK_MIN_WCT(req, 34); 798 parms->ntcreatexreadx.out.oplock_level = CVAL(req->in.vwv, 4); 799 parms->ntcreatexreadx.out.file.fnum = SVAL(req->in.vwv, 5); 800 parms->ntcreatexreadx.out.create_action = IVAL(req->in.vwv, 7); 801 parms->ntcreatexreadx.out.create_time = smbcli_pull_nttime(req->in.vwv, 11); 802 parms->ntcreatexreadx.out.access_time = smbcli_pull_nttime(req->in.vwv, 19); 803 parms->ntcreatexreadx.out.write_time = smbcli_pull_nttime(req->in.vwv, 27); 804 parms->ntcreatexreadx.out.change_time = smbcli_pull_nttime(req->in.vwv, 35); 805 parms->ntcreatexreadx.out.attrib = IVAL(req->in.vwv, 43); 806 parms->ntcreatexreadx.out.alloc_size = BVAL(req->in.vwv, 47); 807 parms->ntcreatexreadx.out.size = BVAL(req->in.vwv, 55); 808 parms->ntcreatexreadx.out.file_type = SVAL(req->in.vwv, 63); 809 parms->ntcreatexreadx.out.ipc_state = SVAL(req->in.vwv, 65); 810 parms->ntcreatexreadx.out.is_directory = CVAL(req->in.vwv, 67); 811 812 status = smbcli_chained_advance(req); 813 if (!NT_STATUS_IS_OK(status)) { 814 return status; 815 } 816 817 SMBCLI_CHECK_WCT(req, 12); 818 parms->ntcreatexreadx.out.remaining = SVAL(req->in.vwv, VWV(2)); 819 parms->ntcreatexreadx.out.compaction_mode = SVAL(req->in.vwv, VWV(3)); 820 parms->ntcreatexreadx.out.nread = SVAL(req->in.vwv, VWV(5)); 821 if (parms->ntcreatexreadx.out.nread > 822 MAX(parms->ntcreatexreadx.in.mincnt, parms->ntcreatexreadx.in.maxcnt) || 823 !smbcli_raw_pull_data(&req->in.bufinfo, req->in.hdr + SVAL(req->in.vwv, VWV(6)), 824 parms->ntcreatexreadx.out.nread, 825 parms->ntcreatexreadx.out.data)) { 826 req->status = NT_STATUS_BUFFER_TOO_SMALL; 827 } 828 break; 829 756 830 case RAW_OPEN_SMB2: 757 831 req->status = NT_STATUS_INTERNAL_ERROR; … … 845 919 case RAW_LOCK_LOCKX: { 846 920 struct smb_lock_entry *lockp; 847 u int_t lck_size = (parms->lockx.in.mode & LOCKING_ANDX_LARGE_FILES)? 20 : 10;848 u int_t lock_count = parms->lockx.in.ulock_cnt + parms->lockx.in.lock_cnt;921 unsigned int lck_size = (parms->lockx.in.mode & LOCKING_ANDX_LARGE_FILES)? 20 : 10; 922 unsigned int lock_count = parms->lockx.in.ulock_cnt + parms->lockx.in.lock_cnt; 849 923 int i; 850 924 -
vendor/current/source4/libcli/raw/rawfileinfo.c
r414 r740 48 48 49 49 while (blob.length - ofs >= 24) { 50 u int_t n = io->num_streams;50 unsigned int n = io->num_streams; 51 51 uint32_t nlen, len; 52 52 bool ret; … … 254 254 NT_STATUS_HAVE_NO_MEMORY(parms->query_secdesc.out.sd); 255 255 256 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL,257 258 256 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, 257 parms->query_secdesc.out.sd, 258 (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); 259 259 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 260 260 return ndr_map_error2ntstatus(ndr_err); -
vendor/current/source4/libcli/raw/rawfsinfo.c
r414 r740 160 160 { 161 161 NTSTATUS status = NT_STATUS_OK; 162 enum ndr_err_code ndr_err;163 162 int i; 164 163 … … 216 215 break; 217 216 218 case RAW_QFS_OBJECTID_INFORMATION: 217 case RAW_QFS_OBJECTID_INFORMATION: { 218 DATA_BLOB b2 = data_blob_const(blob.data, MIN(16, blob.length)); 219 219 QFS_CHECK_SIZE(64); 220 ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL, &fsinfo->objectid_information.out.guid, 221 (ndr_pull_flags_fn_t)ndr_pull_GUID); 222 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 223 status = ndr_map_error2ntstatus(ndr_err); 224 } 220 status = GUID_from_ndr_blob(&b2, &fsinfo->objectid_information.out.guid); 221 NT_STATUS_NOT_OK_RETURN(status); 225 222 for (i=0;i<6;i++) { 226 223 fsinfo->objectid_information.out.unknown[i] = BVAL(blob.data, 16 + i*8); 227 224 } 228 225 break; 226 } 229 227 230 228 default: -
vendor/current/source4/libcli/raw/rawnegotiate.c
r414 r740 153 153 transport->negotiate.writebraw_supported = true; 154 154 } 155 156 if (transport->negotiate.capabilities & CAP_LOCK_AND_READ) 157 transport->negotiate.lockread_supported = true; 155 158 } else if (transport->negotiate.protocol >= PROTOCOL_LANMAN1) { 156 159 SMBCLI_CHECK_WCT(req, 13); -
vendor/current/source4/libcli/raw/rawnotify.c
r414 r740 72 72 parms->nttrans.out.changes = NULL; 73 73 parms->nttrans.out.num_changes = 0; 74 74 75 75 /* count them */ 76 76 for (ofs=0; nt.out.params.length - ofs > 12; ) { 77 77 uint32_t next = IVAL(nt.out.params.data, ofs); 78 if (next % 4 != 0) 79 return NT_STATUS_INVALID_NETWORK_RESPONSE; 78 80 parms->nttrans.out.num_changes++; 79 81 if (next == 0 || … … 156 158 * but we want to keep it under oldreq->ntcancel 157 159 */ 158 if (!talloc_reference(oldreq, req)) { 159 talloc_free(req); 160 return NT_STATUS_NO_MEMORY; 161 } 160 req->do_not_free = true; 161 talloc_steal(oldreq, req); 162 162 163 163 smbcli_request_send(req); -
vendor/current/source4/libcli/raw/rawrequest.c
r414 r740 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 } -
vendor/current/source4/libcli/raw/rawsearch.c
r414 r740 334 334 const DATA_BLOB *blob, 335 335 union smb_search_data *data, 336 u int_t *next_ofs,337 u int_t str_flags)338 { 339 u int_t len, blen;336 unsigned int *next_ofs, 337 unsigned int str_flags) 338 { 339 unsigned int len, blen; 340 340 341 341 if (blob->length < 4) { … … 488 488 union smb_search_data *data) 489 489 { 490 u int_t len, ofs;490 unsigned int len, ofs; 491 491 uint32_t ea_size; 492 492 DATA_BLOB eablob; … … 657 657 case RAW_SEARCH_DATA_ID_FULL_DIRECTORY_INFO: 658 658 case RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO: { 659 u int_t str_flags = STR_UNICODE;659 unsigned int str_flags = STR_UNICODE; 660 660 if (!(tree->session->transport->negotiate.capabilities & CAP_UNICODE)) { 661 661 str_flags = STR_ASCII; … … 695 695 for (i=0; i < count; i++) { 696 696 union smb_search_data search_data; 697 u int_t len;697 unsigned int len; 698 698 699 699 len = parse_trans2_search(tree, mem_ctx, level, flags, &blob2, &search_data); -
vendor/current/source4/libcli/raw/rawsetfileinfo.c
r414 r740 34 34 DATA_BLOB *blob) 35 35 { 36 u int_t len;36 unsigned int len; 37 37 38 38 #define NEED_BLOB(n) do { \ … … 100 100 enum ndr_err_code ndr_err; 101 101 102 ndr_err = ndr_push_struct_blob(blob, mem_ctx, NULL, 103 parms->set_secdesc.in.sd, 102 ndr_err = ndr_push_struct_blob(blob, mem_ctx, parms->set_secdesc.in.sd, 104 103 (ndr_push_flags_fn_t)ndr_push_security_descriptor); 105 104 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { -
vendor/current/source4/libcli/raw/rawtrans.c
r414 r740 30 30 */ 31 31 static bool raw_trans_oob(struct smbcli_request *req, 32 u int_t offset, uint_t count)32 unsigned int offset, unsigned int count) 33 33 { 34 34 uint8_t *ptr; -
vendor/current/source4/libcli/raw/request.h
r414 r740 59 59 into the raw buffer */ 60 60 uint8_t *vwv; 61 u int_t wct;61 unsigned int wct; 62 62 63 63 /* the data buffer and size. data points into the raw buffer */ -
vendor/current/source4/libcli/raw/smb.h
r414 r740 179 179 NTCREATEX_OPTIONS_SYNC_ALERT | \ 180 180 NTCREATEX_OPTIONS_ASYNC_ALERT | \ 181 NTCREATEX_OPTIONS_OPFILTER | \182 181 0xFF000000) 183 182 184 183 /* 185 * We reuse some ignored flags for private use.184 * private_flags field in ntcreatex 186 185 * This values have different meaning for some ntvfs backends. 187 *188 * TODO: use values that are ignore for sure...189 186 */ 190 #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x00010000 191 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x00020000 192 #define NTCREATEX_OPTIONS_PRIVATE_MASK (NTCREATEX_OPTIONS_PRIVATE_DENY_DOS | \ 193 NTCREATEX_OPTIONS_PRIVATE_DENY_FCB) 187 #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x0001 188 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x0002 189 194 190 195 191 /* ntcreatex impersonation field */ … … 371 367 372 368 373 /* Mapping of generic access rights for files to specific rights. */374 #define FILE_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED_ACCESS| NT_ACCESS_SYNCHRONIZE_ACCESS|FILE_ALL_ACCESS)375 376 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ_ACCESS|FILE_READ_DATA|FILE_READ_ATTRIBUTES|\377 FILE_READ_EA|NT_ACCESS_SYNCHRONIZE_ACCESS)378 379 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE_ACCESS|FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|\380 FILE_WRITE_EA|FILE_APPEND_DATA|NT_ACCESS_SYNCHRONIZE_ACCESS)381 382 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE_ACCESS|FILE_READ_ATTRIBUTES|\383 FILE_EXECUTE|NT_ACCESS_SYNCHRONIZE_ACCESS)384 385 386 369 /* FileAttributes (search attributes) field */ 387 370 #define FILE_ATTRIBUTE_READONLY 0x0001 … … 465 448 (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME) 466 449 450 #define FILE_NOTIFY_CHANGE_ALL \ 451 (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | \ 452 FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE | \ 453 FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_LAST_ACCESS | \ 454 FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_EA | \ 455 FILE_NOTIFY_CHANGE_SECURITY | FILE_NOTIFY_CHANGE_STREAM_NAME | \ 456 FILE_NOTIFY_CHANGE_STREAM_SIZE | FILE_NOTIFY_CHANGE_STREAM_WRITE) 457 467 458 /* change notify action results */ 468 459 #define NOTIFY_ACTION_ADDED 1 … … 552 543 553 544 /* Lock types. */ 545 #define LOCKING_ANDX_EXCLUSIVE_LOCK 0x00 554 546 #define LOCKING_ANDX_SHARED_LOCK 0x01 555 547 #define LOCKING_ANDX_OPLOCK_RELEASE 0x02 -
vendor/current/source4/libcli/raw/smb_signing.c
r414 r740 133 133 } 134 134 135 bool check_signed_incoming_message(struct smb_request_buffer *in, DATA_BLOB *mac_key, u int_t seq_num)135 bool check_signed_incoming_message(struct smb_request_buffer *in, DATA_BLOB *mac_key, unsigned int seq_num) 136 136 { 137 137 bool good;
Note:
See TracChangeset
for help on using the changeset viewer.