smdb: use fsp_is_alternate_stream() in open_file()
authorRalph Boehme <slow@samba.org>
Wed, 27 Jul 2022 14:04:24 +0000 (16:04 +0200)
committerJule Anger <janger@samba.org>
Tue, 23 Aug 2022 13:29:09 +0000 (13:29 +0000)
No change in behaviour.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15126
MR: https://gitlab.com/samba-team/samba/-/merge_requests/2643

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 0d3995cec10c5fae8c8b6a1df312062e38437e6f)

source3/smbd/open.c

index 825dd9e1761acaece7ad37da5cebc4872b71e8e6..58dbf8099358e2fdbae98203c61ac08c872a0610 100644 (file)
@@ -1419,7 +1419,7 @@ static NTSTATUS open_file(struct smb_request *req,
 #endif
 
                /* Don't create files with Microsoft wildcard characters. */
-               if (fsp->base_fsp) {
+               if (fsp_is_alternate_stream(fsp)) {
                        /*
                         * wildcard characters are allowed in stream names
                         * only test the basefilename
@@ -1435,7 +1435,7 @@ static NTSTATUS open_file(struct smb_request *req,
                }
 
                /* Can we access this file ? */
-               if (!fsp->base_fsp) {
+               if (!fsp_is_alternate_stream(fsp)) {
                        /* Only do this check on non-stream open. */
                        if (file_existed) {
                                status = smbd_check_access_rights_fsp(