const char *p;
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
- bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
START_PROFILE(SMBgetatr);
struct files_struct *dirfsp = NULL;
uint32_t ucf_flags = ucf_flags_from_smb_request(req);
NTTIME twrp = 0;
+ bool ask_sharemode;
+
if (ucf_flags & UCF_GMT_PATHNAME) {
extract_snapshot_token(fname, &twrp);
}
mode = fdos_mode(smb_fname->fsp);
size = smb_fname->st.st_ex_size;
+ ask_sharemode = fsp_search_ask_sharemode(smb_fname->fsp);
if (ask_sharemode) {
struct timespec write_time_ts;
struct file_id fileid;
bool mask_contains_wcard = False;
bool allow_long_path_components = (req->flags2 & FLAGS2_LONG_PATH_COMPONENTS) ? True : False;
TALLOC_CTX *ctx = talloc_tos();
- bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
struct smbXsrv_connection *xconn = req->xconn;
struct smbd_server_connection *sconn = req->sconn;
files_struct *fsp = NULL;
unsigned int i;
size_t hdr_size = ((uint8_t *)smb_buf(req->outbuf) + 3 - req->outbuf);
size_t available_space = xconn->smb1.sessions.max_send - hdr_size;
+ bool ask_sharemode;
maxentries = MIN(maxentries, available_space/DIR_STRUCT_SIZE);
check_descend = True;
}
+ ask_sharemode = fsp_search_ask_sharemode(fsp);
+
for (i=numentries;(i<maxentries) && !finished;i++) {
finished = !get_dir_entry(ctx,
fsp->dptr,
int space_remaining;
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
- bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
+ bool ask_sharemode;
struct smbd_server_connection *sconn = req->sconn;
uint32_t ucf_flags = ucf_flags_from_smb_request(req);
bool backup_priv = false;
goto out;
}
- if (req->posix_pathnames) {
- /* Always use filesystem for UNIX mtime query. */
- ask_sharemode = false;
- }
-
if (req->posix_pathnames) {
srvstr_get_path_posix(talloc_tos(),
params,
space_remaining = max_data_bytes;
out_of_space = False;
+ ask_sharemode = fsp_search_ask_sharemode(fsp);
+
for (i=0;(i<maxentries) && !finished && !out_of_space;i++) {
bool got_exact_match = False;
int space_remaining;
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
- bool ask_sharemode = lp_smbd_search_ask_sharemode(SNUM(conn));
+ bool ask_sharemode;
TALLOC_CTX *ctx = talloc_tos();
struct smbd_server_connection *sconn = req->sconn;
bool backup_priv = false;
break;
case SMB_FIND_FILE_UNIX:
case SMB_FIND_FILE_UNIX_INFO2:
- /* Always use filesystem for UNIX mtime query. */
- ask_sharemode = false;
if (!lp_smb1_unix_extensions()) {
reply_nterror(req, NT_STATUS_INVALID_LEVEL);
return;
finished = !dptr_SearchDir(fsp->dptr, resume_name, ¤t_pos, &st);
} /* end if resume_name && !continue_bit */
+ ask_sharemode = fsp_search_ask_sharemode(fsp);
+
for (i=0;(i<(int)maxentries) && !finished && !out_of_space ;i++) {
bool got_exact_match = False;
return;
}
- if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ if (fsp_getinfo_ask_sharemode(fsp)) {
fileid = vfs_file_id_from_sbuf(
conn, &smb_fname->st);
get_file_infos(fileid, fsp->name_hash,
reply_nterror(req, status);
return;
}
- if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ if (fsp_getinfo_ask_sharemode(fsp)) {
fileid = vfs_file_id_from_sbuf(
conn, &smb_fname->st);
get_file_infos(fileid, fsp->name_hash,
return;
}
- if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ if (fsp_getinfo_ask_sharemode(fsp)) {
fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st);
get_file_infos(fileid, name_hash, &delete_pending,
&write_time_ts);
return tevent_req_post(req, ev);
}
- if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ if (fsp_getinfo_ask_sharemode(fsp)) {
fileid = vfs_file_id_from_sbuf(
conn, &fsp->fsp_name->st);
get_file_infos(fileid, fsp->name_hash,
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
- if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ if (fsp_getinfo_ask_sharemode(fsp)) {
fileid = vfs_file_id_from_sbuf(
conn, &fsp->fsp_name->st);
get_file_infos(fileid, fsp->name_hash,