From: Ralph Boehme Date: Mon, 3 Dec 2018 10:30:51 +0000 (+0100) Subject: smbd: use lp_smbd_getinfo_ask_sharemode() X-Git-Tag: tdb-1.3.17~495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6606d87739b29962d09c7954c07cb4c25811afd;p=thirdparty%2Fsamba.git smbd: use lp_smbd_getinfo_ask_sharemode() Counterpart for "smbd:search ask sharemode" for getinfo. Pair-Programmed-With: Volker Lendecke Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- 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;