s3: VFS: Complete the replacement of SMB_VFS_SYMLINK() -> SMB_VFS_SYMLINKAT().
authorJeremy Allison <jra@samba.org>
Fri, 30 Aug 2019 21:45:13 +0000 (14:45 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 3 Sep 2019 22:32:30 +0000 (22:32 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep  3 22:32:30 UTC 2019 on sn-devel-184

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
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 96661857b4caa04d43e84c61014b4e201de1ed0b..5a18268e6f47a5c21143e3c54db7347e82e85d5d 100644 (file)
@@ -456,14 +456,6 @@ static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
        return false;
 }
 
-static int skel_symlink(vfs_handle_struct *handle,
-                       const char *link_contents,
-                       const struct smb_filename *new_smb_fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_symlinkat(vfs_handle_struct *handle,
                        const char *link_contents,
                        struct files_struct *dirfsp,
@@ -1098,7 +1090,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .kernel_flock_fn = skel_kernel_flock,
        .linux_setlease_fn = skel_linux_setlease,
        .getlock_fn = skel_getlock,
-       .symlink_fn = skel_symlink,
        .symlinkat_fn = skel_symlinkat,
        .readlinkat_fn = skel_vfs_readlinkat,
        .linkat_fn = skel_linkat,
index 493c18a54173e7523f9eb6d781a699d2d3e46c33..654c0e6ca851d816e8e0cca028f2ba372cb9c2cf 100644 (file)
@@ -556,13 +556,6 @@ static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
        return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
 }
 
-static int skel_symlink(vfs_handle_struct *handle,
-                       const char *link_contents,
-                       const struct smb_filename *new_smb_fname)
-{
-       return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
-}
-
 static int skel_symlinkat(vfs_handle_struct *handle,
                        const char *link_contents,
                        struct files_struct *dirfsp,
@@ -1379,7 +1372,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .kernel_flock_fn = skel_kernel_flock,
        .linux_setlease_fn = skel_linux_setlease,
        .getlock_fn = skel_getlock,
-       .symlink_fn = skel_symlink,
        .symlinkat_fn = skel_symlinkat,
        .readlinkat_fn = skel_vfs_readlinkat,
        .linkat_fn = skel_linkat,
index 6970be1fb5e38047e65cdd4be1e1ba0be779bbe0..6c741e09919cc14df9ca59d9ef7950bb856cb624 100644 (file)
 /* Version 42 - Move SMB_VFS_LINK -> SMB_VFS_LINKAT. */
 /* Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT. */
 /* Version 42 - Move SMB_VFS_READLINK -> SMB_VFS_READLINKAT. */
-/* Version 42 - Add SMB_VFS_SYMLINKAT. */
+/* Version 42 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT. */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -796,9 +796,6 @@ struct vfs_fn_pointers {
                               uint32_t share_mode, uint32_t access_mask);
        int (*linux_setlease_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype);
        bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid);
-       int (*symlink_fn)(struct vfs_handle_struct *handle,
-                               const char *link_contents,
-                               const struct smb_filename *new_smb_fname);
        int (*symlinkat_fn)(struct vfs_handle_struct *handle,
                                const char *link_contents,
                                struct files_struct *dirfsp,
@@ -1334,9 +1331,6 @@ int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,
 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
                          struct files_struct *fsp, off_t *poffset,
                          off_t *pcount, int *ptype, pid_t *ppid);
-int smb_vfs_call_symlink(struct vfs_handle_struct *handle,
-                       const char *link_contents,
-                       const struct smb_filename *new_smb_fname);
 int smb_vfs_call_symlinkat(struct vfs_handle_struct *handle,
                        const char *link_contents,
                        struct files_struct *dirfsp,
@@ -1769,9 +1763,6 @@ int vfs_not_implemented_linux_setlease(struct vfs_handle_struct *handle,
 bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
                                 off_t *poffset, off_t *pcount, int *ptype,
                                 pid_t *ppid);
-int vfs_not_implemented_symlink(vfs_handle_struct *handle,
-                               const char *link_contents,
-                               const struct smb_filename *new_smb_fname);
 int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
                                const char *link_contents,
                                struct files_struct *dirfsp,
index f34becaadfa87b9086a55ae885b42285db18700f..c43a7e5a4b539aada81921c1fc73a63465f9abfd 100644 (file)
 #define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) \
        smb_vfs_call_getlock((handle)->next, (fsp), (poffset), (pcount), (ptype), (ppid))
 
-#define SMB_VFS_SYMLINK(conn, oldpath, newpath) \
-       smb_vfs_call_symlink((conn)->vfs_handles, (oldpath), (newpath))
-#define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) \
-       smb_vfs_call_symlink((handle)->next, (oldpath), (newpath))
-
 #define SMB_VFS_SYMLINKAT(conn, oldpath, dirfsp, newpath) \
        smb_vfs_call_symlinkat((conn)->vfs_handles, (oldpath), (dirfsp), (newpath))
 #define SMB_VFS_NEXT_SYMLINKAT(handle, oldpath, dirfsp, newpath) \
index 4b4d7884694f99dacc6fe12b4b2ca6ddf7cb1a01..bb7eba40df930907fdd0c6bd4b5598dcc69932d1 100644 (file)
@@ -2638,18 +2638,6 @@ static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
        return result;
 }
 
-static int vfswrap_symlink(vfs_handle_struct *handle,
-                       const char *link_target,
-                       const struct smb_filename *new_smb_fname)
-{
-       int result;
-
-       START_PROFILE(syscall_symlink);
-       result = symlink(link_target, new_smb_fname->base_name);
-       END_PROFILE(syscall_symlink);
-       return result;
-}
-
 static int vfswrap_symlinkat(vfs_handle_struct *handle,
                        const char *link_target,
                        struct files_struct *dirfsp,
@@ -3511,7 +3499,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .kernel_flock_fn = vfswrap_kernel_flock,
        .linux_setlease_fn = vfswrap_linux_setlease,
        .getlock_fn = vfswrap_getlock,
-       .symlink_fn = vfswrap_symlink,
        .symlinkat_fn = vfswrap_symlinkat,
        .readlinkat_fn = vfswrap_readlinkat,
        .linkat_fn = vfswrap_linkat,
index b8b5f77b36fae74375c451db94cf8d3680e20c78..6009abd8d7e2765d80999d1ef164c9b883c58430 100644 (file)
@@ -454,14 +454,6 @@ bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
        return false;
 }
 
-int vfs_not_implemented_symlink(vfs_handle_struct *handle,
-                               const char *link_contents,
-                               const struct smb_filename *new_smb_fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
                                const char *link_contents,
                                struct files_struct *dirfsp,
@@ -1102,7 +1094,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .kernel_flock_fn = vfs_not_implemented_kernel_flock,
        .linux_setlease_fn = vfs_not_implemented_linux_setlease,
        .getlock_fn = vfs_not_implemented_getlock,
-       .symlink_fn = vfs_not_implemented_symlink,
        .symlinkat_fn = vfs_not_implemented_symlinkat,
        .readlinkat_fn = vfs_not_implemented_vfs_readlinkat,
        .linkat_fn = vfs_not_implemented_linkat,
index e8fdb728ad5829ea21020c4644f5c6778dd23660..c50ee55469d7af3748d4b3023ea7d729acf674b7 100644 (file)
@@ -2193,14 +2193,6 @@ int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,
        return handle->fns->linux_setlease_fn(handle, fsp, leasetype);
 }
 
-int smb_vfs_call_symlink(struct vfs_handle_struct *handle,
-                       const char *link_target,
-                       const struct smb_filename *new_smb_fname)
-{
-       VFS_FIND(symlink);
-       return handle->fns->symlink_fn(handle, link_target, new_smb_fname);
-}
-
 int smb_vfs_call_symlinkat(struct vfs_handle_struct *handle,
                        const char *link_target,
                        struct files_struct *dirfsp,