s3: VFS: Complete the replacement of SMB_VFS_MKDIR() -> SMB_VFS_MKDIRAT().
authorJeremy Allison <jra@samba.org>
Fri, 6 Sep 2019 23:01:20 +0000 (16:01 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 11 Sep 2019 19:44:44 +0000 (19:44 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Sep 11 19:44:44 UTC 2019 on sn-devel-184

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/smbprofile.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_default.c
source3/modules/vfs_not_implemented.c
source3/smbd/vfs.c

index a4bfe81966b6fc9d5e3d46e428523da8041e08a2..c03a42fee040b34b9849097effcad2c45738e1b8 100644 (file)
@@ -165,14 +165,6 @@ static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        ;
 }
 
-static int skel_mkdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
                const struct smb_filename *smb_fname,
@@ -1059,7 +1051,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .seekdir_fn = skel_seekdir,
        .telldir_fn = skel_telldir,
        .rewind_dir_fn = skel_rewind_dir,
-       .mkdir_fn = skel_mkdir,
        .mkdirat_fn = skel_mkdirat,
        .rmdir_fn = skel_rmdir,
        .closedir_fn = skel_closedir,
index b827d2ff77cc160e695fcd4c41dfa94427d667f4..656c933338a901e994030bfcbd31321215feb41d 100644 (file)
@@ -164,13 +164,6 @@ static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        SMB_VFS_NEXT_REWINDDIR(handle, dirp);
 }
 
-static int skel_mkdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               mode_t mode)
-{
-       return SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
-}
-
 static int skel_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
                const struct smb_filename *smb_fname,
@@ -1343,7 +1336,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .seekdir_fn = skel_seekdir,
        .telldir_fn = skel_telldir,
        .rewind_dir_fn = skel_rewind_dir,
-       .mkdir_fn = skel_mkdir,
        .mkdirat_fn = skel_mkdirat,
        .rmdir_fn = skel_rmdir,
        .closedir_fn = skel_closedir,
index e1b933ea2dda1d86ed8bc665c3ff36b078ddfa65..489a613e3df948c89f9b3e1a7e5d20bea0db1bae 100644 (file)
@@ -48,7 +48,6 @@ struct tevent_context;
        SMBPROFILE_STATS_BASIC(syscall_seekdir) \
        SMBPROFILE_STATS_BASIC(syscall_telldir) \
        SMBPROFILE_STATS_BASIC(syscall_rewinddir) \
-       SMBPROFILE_STATS_BASIC(syscall_mkdir) \
        SMBPROFILE_STATS_BASIC(syscall_mkdirat) \
        SMBPROFILE_STATS_BASIC(syscall_rmdir) \
        SMBPROFILE_STATS_BASIC(syscall_closedir) \
index 9ecc0e554970891dba5b3f440e8ea717b9172f76..d164e91e88611e59318ee3996909ab85653eaf35 100644 (file)
 /* Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT. */
 /* Version 42 - Move SMB_VFS_READLINK -> SMB_VFS_READLINKAT. */
 /* Version 42 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT. */
-/* Version 42 - Add SMB_VFS_MKDIRAT. */
+/* Version 42 - Move SMB_VFS_MKDIR -> SMB_VFS_MKDIRAT. */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -699,9 +699,6 @@ struct vfs_fn_pointers {
        void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset);
        long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
        void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
-       int (*mkdir_fn)(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode);
        int (*mkdirat_fn)(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1210,9 +1207,6 @@ long smb_vfs_call_telldir(struct vfs_handle_struct *handle,
                          DIR *dirp);
 void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
                             DIR *dirp);
-int smb_vfs_call_mkdir(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode);
 int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1661,9 +1655,6 @@ struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
 void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset);
 long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp);
 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp);
-int vfs_not_implemented_mkdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               mode_t mode);
 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
                const struct smb_filename *smb_fname,
index a093a08ee118b7538e1994b7a8b6a2ff5b444363..6d95d840e256094190b52eea4dac5d033ab3e3f4 100644 (file)
 #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \
        smb_vfs_call_rewind_dir((handle)->next, (dirp))
 
-#define SMB_VFS_MKDIR(conn, smb_fname, mode) \
-       smb_vfs_call_mkdir((conn)->vfs_handles,(smb_fname), (mode))
-#define SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode) \
-       smb_vfs_call_mkdir((handle)->next,(smb_fname), (mode))
-
 #define SMB_VFS_MKDIRAT(conn, dirfsp, smb_fname, mode) \
        smb_vfs_call_mkdirat((conn)->vfs_handles,(dirfsp), (smb_fname), (mode))
 #define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \
index 2e353e5da75c324a7fa8b59462dce07a56e7b6ad..4cca80ea397dac7adae26168b57bdb28f91035c7 100644 (file)
@@ -493,30 +493,6 @@ static void vfswrap_rewinddir(vfs_handle_struct *handle, DIR *dirp)
        END_PROFILE(syscall_rewinddir);
 }
 
-static int vfswrap_mkdir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       int result;
-       const char *path = smb_fname->base_name;
-       char *parent = NULL;
-
-       START_PROFILE(syscall_mkdir);
-
-       if (lp_inherit_acls(SNUM(handle->conn))
-           && parent_dirname(talloc_tos(), path, &parent, NULL)
-           && directory_has_default_acl(handle->conn, parent)) {
-               mode = (0777 & lp_directory_mask(SNUM(handle->conn)));
-       }
-
-       TALLOC_FREE(parent);
-
-       result = mkdir(path, mode);
-
-       END_PROFILE(syscall_mkdir);
-       return result;
-}
-
 static int vfswrap_mkdirat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -3486,7 +3462,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .seekdir_fn = vfswrap_seekdir,
        .telldir_fn = vfswrap_telldir,
        .rewind_dir_fn = vfswrap_rewinddir,
-       .mkdir_fn = vfswrap_mkdir,
        .mkdirat_fn = vfswrap_mkdirat,
        .rmdir_fn = vfswrap_rmdir,
        .closedir_fn = vfswrap_closedir,
index 9fa143a6729543be494e20274acbc7576450c07e..e0f36b9a6324e69d9b2467b747723f53b08ef0a9 100644 (file)
@@ -162,14 +162,6 @@ void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        ;
 }
 
-int vfs_not_implemented_mkdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
                const struct smb_filename *smb_fname,
@@ -1063,7 +1055,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .seekdir_fn = vfs_not_implemented_seekdir,
        .telldir_fn = vfs_not_implemented_telldir,
        .rewind_dir_fn = vfs_not_implemented_rewind_dir,
-       .mkdir_fn = vfs_not_implemented_mkdir,
        .mkdirat_fn = vfs_not_implemented_mkdirat,
        .rmdir_fn = vfs_not_implemented_rmdir,
        .closedir_fn = vfs_not_implemented_closedir,
index 836fcf41e6576d474e9a48ec27e2fb4f652297ef..ddc7df1405b6dcbba614aeab0ac2e253e89d3c63 100644 (file)
@@ -1580,14 +1580,6 @@ void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
        handle->fns->rewind_dir_fn(handle, dirp);
 }
 
-int smb_vfs_call_mkdir(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       VFS_FIND(mkdir);
-       return handle->fns->mkdir_fn(handle, smb_fname, mode);
-}
-
 int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,