]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/libadouble: use openat_pathref_fsp() in ad_open_rsrc()
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 11:34:21 +0000 (12:34 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Ensures we have a pathref handle in the smb_fname we pass to
SMB_VFS_CREATE_FILE().

As the create_disposition is FILE_OPEN we just return the error if
openat_pathref_fsp() fails

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/adouble.c

index 99f948103c835b62b4985eec94b661e8d4b467ce..0155c2ccc8dd837fb013a3e213511efa379920f2 100644 (file)
@@ -2109,6 +2109,11 @@ static int ad_open_rsrc(vfs_handle_struct *handle,
                share_access &= ~FILE_SHARE_WRITE;
        }
 
+       status = openat_pathref_fsp(handle->conn->cwd_fsp, adp_smb_fname);
+       if (!NT_STATUS_IS_OK(status)) {
+               return -1;
+       }
+
        status = SMB_VFS_CREATE_FILE(
                handle->conn,                   /* conn */
                NULL,                           /* req */