]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_linux_xfs_sgid: support real dirfsps in linux_xfs_sgid_mkdirat()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 14:49:15 +0000 (15:49 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_linux_xfs_sgid.c

index f112f119faeb20719312b43035fa8a1e81d354df..e55734f806faea690b89ff9f2b07b86cd98b22fb 100644 (file)
@@ -46,7 +46,14 @@ static int linux_xfs_sgid_mkdirat(vfs_handle_struct *handle,
                return mkdir_res;
        }
 
-       ok = parent_smb_fname(talloc_tos(), smb_fname, &dname, NULL);
+       fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                            dirfsp,
+                                            smb_fname);
+       if (fname == NULL) {
+               return -1;
+       }
+
+       ok = parent_smb_fname(talloc_tos(), fname, &dname, NULL);
        if (!ok) {
                DBG_WARNING("parent_smb_fname() failed\n");
                /* return success, we did the mkdir */
@@ -69,13 +76,6 @@ static int linux_xfs_sgid_mkdirat(vfs_handle_struct *handle,
        }
        TALLOC_FREE(dname);
 
-       fname = cp_smb_filename(talloc_tos(), smb_fname);
-       if (fname == NULL) {
-               DBG_WARNING("cp_smb_filename() failed\n");
-               /* return success, we did the mkdir */
-               return mkdir_res;
-       }
-
        res = SMB_VFS_NEXT_STAT(handle, fname);
        if (res == -1) {
                DBG_NOTICE("Could not stat just created dir %s: %s\n",