diff options
author | Dan McDonald <danmcd@mnx.io> | 2022-11-02 15:33:38 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@mnx.io> | 2022-11-02 15:33:38 -0400 |
commit | 7f315fffd5e0b591b23ba9d68b6f5925c6cb2f0b (patch) | |
tree | b8fd307a012f58b1e6c3cbdea0ac7fe1a1cd3c7d | |
parent | 2ebf7119d3f61d886cb795f844775bb63c0d4835 (diff) | |
parent | 48f31ae786d40628787e82ea7955dca7c6ffbeae (diff) | |
download | illumos-joyent-release-20221103.tar.gz |
[illumos-gate merge]release-20221103
commit 48f31ae786d40628787e82ea7955dca7c6ffbeae
15099 WPTS BVT_SMB2Basic_ChangeNotify_ChangeSecurity
commit 6cd1873200c86b91025b7a2ed64da4fe509f8187
15098 WPTS BVT_SMB2Basic_ChangeNotify_NoFileListDirectoryInGrantedAccess
commit b202d9e70f4ebef67c6d2e0e86348704df24fc30
15097 WPTS BVT_SMB2Basic_ChangeNotify_MaxTransactSizeCheck_Smb21
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb2_change_notify.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb_fsops.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb_notify.c | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb2_change_notify.c b/usr/src/uts/common/fs/smbsrv/smb2_change_notify.c index 911e3544f6..1aab018e80 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_change_notify.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_change_notify.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. * Copyright 2018 Nexenta Systems, Inc. All rights reserved. + * Copyright 2022 RackTop Systems, Inc. */ /* @@ -80,8 +81,10 @@ smb2_change_notify(smb_request_t *sr) if (iFlags & SMB2_WATCH_TREE) CompletionFilter |= FILE_NOTIFY_CHANGE_EV_SUBDIR; - if (oBufLength > smb2_max_trans) - oBufLength = smb2_max_trans; + if (oBufLength > smb2_max_trans) { + status = NT_STATUS_INVALID_PARAMETER; + goto errout; + } /* * Check for events and consume, non-blocking. diff --git a/usr/src/uts/common/fs/smbsrv/smb_fsops.c b/usr/src/uts/common/fs/smbsrv/smb_fsops.c index 1d46497877..ef58f15fa8 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_fsops.c +++ b/usr/src/uts/common/fs/smbsrv/smb_fsops.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012-2021 Tintri by DDN, Inc. All rights reserved. + * Copyright 2022 RackTop Systems, Inc. */ #include <sys/sid.h> @@ -2335,6 +2336,11 @@ smb_fsop_aclwrite(smb_request_t *sr, cred_t *cr, smb_node_t *snode, flags = ATTR_NOACLCHECK; error = smb_vop_acl_write(snode->vp, acl, flags, cr); + if (error == 0 && snode->n_dnode != NULL) { + // FILE_NOTIFY_CHANGE_SECURITY + smb_node_notify_change(snode->n_dnode, + FILE_ACTION_MODIFIED, snode->od_name); + } } if (dacl && sacl) diff --git a/usr/src/uts/common/fs/smbsrv/smb_notify.c b/usr/src/uts/common/fs/smbsrv/smb_notify.c index 602fa1db3b..4a79026b8b 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_notify.c +++ b/usr/src/uts/common/fs/smbsrv/smb_notify.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2020 Tintri by DDN, Inc. All rights reserved. + * Copyright 2022 RackTop Systems, Inc. */ /* @@ -198,6 +199,9 @@ smb_notify_act1(smb_request_t *sr, uint32_t buflen, uint32_t filter) return (NT_STATUS_INVALID_PARAMETER); } + if ((of->f_granted_access & FILE_LIST_DIRECTORY) == 0) + return (NT_STATUS_ACCESS_DENIED); + mutex_enter(&of->f_mutex); /* |