Lines Matching refs:sr

204 smb_pre_search(smb_request_t *sr)  in smb_pre_search()  argument
206 DTRACE_SMB_START(op__Search, smb_request_t *, sr); in smb_pre_search()
211 smb_post_search(smb_request_t *sr) in smb_post_search() argument
213 DTRACE_SMB_DONE(op__Search, smb_request_t *, sr); in smb_post_search()
217 smb_com_search(smb_request_t *sr) in smb_com_search() argument
238 if ((sr->session->dialect <= LANMAN1_0) || in smb_com_search()
239 ((sr->smb_flg2 & SMB_FLAGS2_KNOWS_LONG_NAMES) == 0)) { in smb_com_search()
244 sr->smb_flg2 &= ~SMB_FLAGS2_KNOWS_LONG_NAMES; in smb_com_search()
245 sr->smb_flg &= ~SMB_FLAGS_CASE_INSENSITIVE; in smb_com_search()
247 if (smbsr_decode_vwv(sr, "ww", &maxcount, &sattr) != 0) in smb_com_search()
250 pn = &sr->arg.dirop.fqi.fq_path; in smb_com_search()
251 rc = smbsr_decode_data(sr, "%Abw", sr, &pn->pn_path, &type, &key_len); in smb_com_search()
255 smb_pathname_init(sr, pn, pn->pn_path); in smb_com_search()
256 if (!smb_pathname_validate(sr, pn) || in smb_com_search()
258 smbsr_warn(sr, NT_STATUS_NO_MORE_FILES, in smb_com_search()
263 tree = sr->tid_tree; in smb_com_search()
271 (void) smb_mbc_decodef(&sr->smb_data, "17.l", in smb_com_search()
277 (void) smb_mbc_encodef(&sr->reply, "bwwbwb11c5.lb8.13c", in smb_com_search()
281 rc = (sr->reply.chain_offset - sr->cur_reply_offset) - 8; in smb_com_search()
282 (void) smb_mbc_poke(&sr->reply, sr->cur_reply_offset, "bwwbw", in smb_com_search()
296 status = smb_odir_openpath(sr, pn->pn_path, sattr, 0, &od); in smb_com_search()
299 smbsr_warn(sr, NT_STATUS_NO_MORE_FILES, in smb_com_search()
305 if (smb_mbc_decodef(&sr->smb_data, "b12.wwl", in smb_com_search()
309 od = smb_tree_lookup_odir(sr, odid); in smb_com_search()
313 smbsr_error(sr, NT_STATUS_INVALID_HANDLE, in smb_com_search()
328 (void) smb_mbc_encodef(&sr->reply, "bwwbw", 1, 0, VAR_BCC, 5, 0); in smb_com_search()
337 rc = smb_odir_read_fileinfo(sr, od, &fileinfo, &eos); in smb_com_search()
351 (void) smb_mbc_encodef(&sr->reply, "b11c.wwlbYl13c", in smb_com_search()
354 smb_time_gmt_to_local(sr, fileinfo.fi_mtime.tv_sec), in smb_com_search()
375 smbsr_warn(sr, NT_STATUS_NO_MORE_FILES, in smb_com_search()
380 rc = (sr->reply.chain_offset - sr->cur_reply_offset) - 8; in smb_com_search()
381 if (smb_mbc_poke(&sr->reply, sr->cur_reply_offset, "bwwbw", in smb_com_search()
396 smb_pre_find(smb_request_t *sr) in smb_pre_find() argument
398 DTRACE_SMB_START(op__Find, smb_request_t *, sr); in smb_pre_find()
403 smb_post_find(smb_request_t *sr) in smb_post_find() argument
405 DTRACE_SMB_DONE(op__Find, smb_request_t *, sr); in smb_post_find()
409 smb_com_find(smb_request_t *sr) in smb_com_find() argument
428 if (smbsr_decode_vwv(sr, "ww", &maxcount, &sattr) != 0) in smb_com_find()
431 pn = &sr->arg.dirop.fqi.fq_path; in smb_com_find()
432 rc = smbsr_decode_data(sr, "%Abw", sr, &pn->pn_path, &type, &key_len); in smb_com_find()
439 smb_pathname_init(sr, pn, pn->pn_path); in smb_com_find()
440 if (!smb_pathname_validate(sr, pn)) in smb_com_find()
444 smbsr_error(sr, NT_STATUS_OBJECT_NAME_INVALID, in smb_com_find()
454 status = smb_odir_openpath(sr, pn->pn_path, sattr, 0, &od); in smb_com_find()
456 smbsr_error(sr, status, 0, 0); in smb_com_find()
461 if (smb_mbc_decodef(&sr->smb_data, "b12.wwl", in smb_com_find()
465 od = smb_tree_lookup_odir(sr, odid); in smb_com_find()
469 smbsr_error(sr, NT_STATUS_INVALID_HANDLE, in smb_com_find()
484 (void) smb_mbc_encodef(&sr->reply, "bwwbw", 1, 0, VAR_BCC, 5, 0); in smb_com_find()
493 rc = smb_odir_read_fileinfo(sr, od, &fileinfo, &eos); in smb_com_find()
505 (void) smb_mbc_encodef(&sr->reply, "b11c.wwlbYl13c", in smb_com_find()
508 smb_time_gmt_to_local(sr, fileinfo.fi_mtime.tv_sec), in smb_com_find()
529 smbsr_warn(sr, NT_STATUS_NO_MORE_FILES, in smb_com_find()
534 rc = (MBC_LENGTH(&sr->reply) - sr->cur_reply_offset) - 8; in smb_com_find()
535 if (smb_mbc_poke(&sr->reply, sr->cur_reply_offset, "bwwbw", in smb_com_find()
550 smb_pre_find_close(smb_request_t *sr) in smb_pre_find_close() argument
552 DTRACE_SMB_START(op__FindClose, smb_request_t *, sr); in smb_pre_find_close()
557 smb_post_find_close(smb_request_t *sr) in smb_post_find_close() argument
559 DTRACE_SMB_DONE(op__FindClose, smb_request_t *, sr); in smb_post_find_close()
563 smb_com_find_close(smb_request_t *sr) in smb_com_find_close() argument
575 if (smbsr_decode_vwv(sr, "ww", &maxcount, &sattr) != 0) in smb_com_find_close()
578 rc = smbsr_decode_data(sr, "%Abw", sr, &path, &type, &key_len); in smb_com_find_close()
583 smbsr_error(sr, NT_STATUS_INVALID_HANDLE, in smb_com_find_close()
591 if (smb_mbc_decodef(&sr->smb_data, "b12.wwl", in smb_com_find_close()
596 od = smb_tree_lookup_odir(sr, odid); in smb_com_find_close()
598 smbsr_error(sr, NT_STATUS_INVALID_HANDLE, in smb_com_find_close()
606 if (smbsr_encode_result(sr, 1, 3, "bwwbw", 1, 0, 3, 5, 0)) in smb_com_find_close()
616 smb_pre_find_unique(smb_request_t *sr) in smb_pre_find_unique() argument
618 DTRACE_SMB_START(op__FindUnique, smb_request_t *, sr); in smb_pre_find_unique()
623 smb_post_find_unique(smb_request_t *sr) in smb_post_find_unique() argument
625 DTRACE_SMB_DONE(op__FindUnique, smb_request_t *, sr); in smb_post_find_unique()
629 smb_com_find_unique(struct smb_request *sr) in smb_com_find_unique() argument
644 if (smbsr_decode_vwv(sr, "ww", &maxcount, &sattr) != 0) in smb_com_find_unique()
647 pn = &sr->arg.dirop.fqi.fq_path; in smb_com_find_unique()
649 if ((smbsr_decode_data(sr, "%AV", sr, &pn->pn_path, vdb) != 0) || in smb_com_find_unique()
656 smb_pathname_init(sr, pn, pn->pn_path); in smb_com_find_unique()
657 if (!smb_pathname_validate(sr, pn)) in smb_com_find_unique()
661 smbsr_error(sr, NT_STATUS_OBJECT_NAME_INVALID, in smb_com_find_unique()
666 (void) smb_mbc_encodef(&sr->reply, "bwwbw", 1, 0, VAR_BCC, 5, 0); in smb_com_find_unique()
668 status = smb_odir_openpath(sr, pn->pn_path, sattr, 0, &od); in smb_com_find_unique()
670 smbsr_error(sr, status, 0, 0); in smb_com_find_unique()
683 rc = smb_odir_read_fileinfo(sr, od, &fileinfo, &eos); in smb_com_find_unique()
695 (void) smb_mbc_encodef(&sr->reply, "b11c.wwlbYl13c", in smb_com_find_unique()
698 smb_time_gmt_to_local(sr, fileinfo.fi_mtime.tv_sec), in smb_com_find_unique()
715 smbsr_warn(sr, NT_STATUS_NO_MORE_FILES, in smb_com_find_unique()
720 rc = (MBC_LENGTH(&sr->reply) - sr->cur_reply_offset) - 8; in smb_com_find_unique()
721 if (smb_mbc_poke(&sr->reply, sr->cur_reply_offset, in smb_com_find_unique()