From 5cfb18f0d1f59686e64a1bf142efa2bf653d86a0 Mon Sep 17 00:00:00 2001 From: Matt Barden Date: Fri, 26 Mar 2021 17:24:37 -0400 Subject: 15032 SMB: Can't create a file with a NULL DACL Reviewed by: Gordon Ross Reviewed by: Toomas Soome Reviewed by: Prashanth Badari Approved by: Dan McDonald --- usr/src/uts/common/fs/smbsrv/smb_sd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/fs/smbsrv/smb_sd.c b/usr/src/uts/common/fs/smbsrv/smb_sd.c index 946503fa8f..b5dc88db58 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_sd.c +++ b/usr/src/uts/common/fs/smbsrv/smb_sd.c @@ -89,6 +89,9 @@ smb_sd_len(smb_sd_t *sd, uint32_t secinfo) * * Return the security information mask for the specified security * descriptor. + * + * Note: This is used for 'create-with-sd'. 'set-security-info' provides the + * secinfo as part of the request, but create does not, so we must infer it. */ uint32_t smb_sd_get_secinfo(smb_sd_t *sd) @@ -104,10 +107,10 @@ smb_sd_get_secinfo(smb_sd_t *sd) if (sd->sd_group) sec_info |= SMB_GROUP_SECINFO; - if (sd->sd_dacl) + if ((sd->sd_control & SE_DACL_PRESENT) != 0) sec_info |= SMB_DACL_SECINFO; - if (sd->sd_sacl) + if ((sd->sd_control & SE_SACL_PRESENT) != 0) sec_info |= SMB_SACL_SECINFO; return (sec_info); -- cgit v1.2.3