summaryrefslogtreecommitdiff
path: root/usr/src/uts
diff options
context:
space:
mode:
authorGordon Ross <gwr@racktopsystems.com>2022-01-16 20:36:44 -0500
committerToomas Soome <tsoome@me.com>2022-11-28 21:06:10 +0200
commit36d5d64dcecbec1dfcdcf7b4b57d1917c18a7e6f (patch)
treed49926a1ace56d529c06f8e87c0cd304f676ec11 /usr/src/uts
parent218c1e8d5b1b53d614b55e423b8b0a03f728e2e3 (diff)
downloadillumos-gate-36d5d64dcecbec1dfcdcf7b4b57d1917c18a7e6f.tar.gz
15156 WPTS FSA FileInfo_Query_FileModeInformation
Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Andy Stormont <andyjstormont@gmail.com> Reviewed by: Matt Barden <mbarden@racktopsystems.com> Approved by: Patrick Mooney <pmooney@pfmooney.com>
Diffstat (limited to 'usr/src/uts')
-rw-r--r--usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c b/usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c
index dcfd771baa..6f70a8d74b 100644
--- a/usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c
+++ b/usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c
@@ -482,17 +482,35 @@ smb2_qif_position(smb_request_t *sr, smb_queryinfo_t *qi)
/*
* FileModeInformation [MS-FSA 2.4.24]
- * XXX: These mode flags are supposed to be on the open handle,
- * XXX: or I think so. Not yet... (just put zero for now)
*/
static uint32_t
smb2_qif_mode(smb_request_t *sr, smb_queryinfo_t *qi)
{
_NOTE(ARGUNUSED(qi))
+ smb_ofile_t *of = sr->fid_ofile;
+ uint32_t mode;
int rc;
+ /*
+ * See MS-FSA description of Open.Mode
+ * For now, we have these in...
+ */
+ mode = of->f_create_options &
+ (FILE_WRITE_THROUGH | FILE_SEQUENTIAL_ONLY |
+ FILE_NO_INTERMEDIATE_BUFFERING | FILE_DELETE_ON_CLOSE);
+
+ /*
+ * The ofile level DoC flag is currently in of->f_flags
+ * (SMB_OFLAGS_SET_DELETE_ON_CLOSE) though probably it
+ * should be in f_create_options (and perhaps rename
+ * that field to f_mode or something closer to the
+ * Open.Mode terminology used in MS-FSA).
+ */
+ if (of->f_flags & SMB_OFLAGS_SET_DELETE_ON_CLOSE)
+ mode |= FILE_DELETE_ON_CLOSE;
+
rc = smb_mbc_encodef(
- &sr->raw_data, "l", 0);
+ &sr->raw_data, "l", mode);
if (rc != 0)
return (NT_STATUS_BUFFER_OVERFLOW);