summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-12-03 11:30:51 +0100
committerJeremy Allison <jra@samba.org>2018-12-06 01:43:14 +0100
commita6606d87739b29962d09c7954c07cb4c25811afd (patch)
treeabd67189cce1f8dadf1b41aec6e3697662b60039 /source3
parent38d819e89924e2a93d7e3fca14471497d5d24d25 (diff)
downloadsamba-a6606d87739b29962d09c7954c07cb4c25811afd.tar.gz
smbd: use lp_smbd_getinfo_ask_sharemode()
Counterpart for "smbd:search ask sharemode" for getinfo. Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_getinfo.c22
-rw-r--r--source3/smbd/trans2.c26
2 files changed, 34 insertions, 14 deletions
diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c
index 7bded422520..314f44e858c 100644
--- a/source3/smbd/smb2_getinfo.c
+++ b/source3/smbd/smb2_getinfo.c
@@ -353,10 +353,13 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- fileid = vfs_file_id_from_sbuf(conn,
- &fsp->fsp_name->st);
- get_file_infos(fileid, fsp->name_hash,
- &delete_pending, &write_time_ts);
+ if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ fileid = vfs_file_id_from_sbuf(
+ conn, &fsp->fsp_name->st);
+ get_file_infos(fileid, fsp->name_hash,
+ &delete_pending,
+ &write_time_ts);
+ }
} else {
/*
* Original code - this is an open file.
@@ -370,10 +373,13 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
- fileid = vfs_file_id_from_sbuf(conn,
- &fsp->fsp_name->st);
- get_file_infos(fileid, fsp->name_hash,
- &delete_pending, &write_time_ts);
+ if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ fileid = vfs_file_id_from_sbuf(
+ conn, &fsp->fsp_name->st);
+ get_file_infos(fileid, fsp->name_hash,
+ &delete_pending,
+ &write_time_ts);
+ }
}
status = smbd_do_qfilepathinfo(conn, state,
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 306174e597d..d3497fed0b4 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -5785,8 +5785,13 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
- fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st);
- get_file_infos(fileid, fsp->name_hash, &delete_pending, &write_time_ts);
+ if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ fileid = vfs_file_id_from_sbuf(
+ conn, &smb_fname->st);
+ get_file_infos(fileid, fsp->name_hash,
+ &delete_pending,
+ &write_time_ts);
+ }
} else {
/*
* Original code - this is an open file.
@@ -5798,8 +5803,13 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
map_nt_error_from_unix(errno));
return;
}
- fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st);
- get_file_infos(fileid, fsp->name_hash, &delete_pending, &write_time_ts);
+ if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ fileid = vfs_file_id_from_sbuf(
+ conn, &smb_fname->st);
+ get_file_infos(fileid, fsp->name_hash,
+ &delete_pending,
+ &write_time_ts);
+ }
}
} else {
@@ -5967,8 +5977,12 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
- fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st);
- get_file_infos(fileid, name_hash, &delete_pending, &write_time_ts);
+ if (lp_smbd_getinfo_ask_sharemode(SNUM(conn))) {
+ fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st);
+ get_file_infos(fileid, name_hash, &delete_pending,
+ &write_time_ts);
+ }
+
if (delete_pending) {
reply_nterror(req, NT_STATUS_DELETE_PENDING);
return;