[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Sep 3 22:33:02 UTC 2019


The branch, master has been updated
       via  c5ea3d045af s3: VFS: Complete the replacement of SMB_VFS_SYMLINK() -> SMB_VFS_SYMLINKAT().
       via  ea5a02e8110 s3: VFS: vfs_time_audit. Remove symlink_fn(). No longer used.
       via  2fa1cd37c20 s3: VFS: vfs_full_audit. Remove symlink_fn(). No longer used.
       via  a676e494cde s3: VFS: vfs_unityed_media. Remove symlink_fn(). No longer used.
       via  8ef64494c6d s3: VFS: vfs_syncops. Remove symlink_fn(). No longer used.
       via  d492f4d1031 s3: VFS: vfs_snapper. Remove symlink_fn(). No longer used.
       via  a521377e200 s3: VFS: vfs_shadow_copy2. Remove symlink_fn(). No longer used.
       via  9b3d3904c65 s3: VFS: vfs_media_harmony. Remove symlink_fn(). No longer used.
       via  cb3b0ee853a s3: VFS: vfs_glusterfs. Remove symlink_fn(). No longer used.
       via  33c00a61d83 s3: VFS: vfs_ceph_snapshots. Remove symlink_fn(). No longer used.
       via  1ee61e214a5 s3: VFS: vfs_ceph. Remove symlink_fn(). No longer used.
       via  d970556b682 s3: VFS: vfs_cap. Remove symlink_fn(). No longer used.
       via  daf78b0271a s3: smbd: Change create_msdfs_link() to call SMB_VFS_SYMLINKAT().
       via  538f78f07b6 s3: smbd: Change smb_set_file_unix_link() to call SMB_VFS_SYMLINKAT().
       via  1354f2f5210 s3: torture: Change cmd_symlink to call SMB_VFS_SYMLINKAT().
       via  8c851da40f0 s3: VFS: vfs_unityed_media. Implement symlinkat().
       via  f6d63ff6446 s3: VFS: vfs_time_audit. Implement symlinkat().
       via  4f5de7061eb s3: VFS: vfs_syncops. Implement symlinkat().
       via  787487ae3ee s3: VFS: vfs_snapper. Implement symlinkat().
       via  e033047559e s3: VFS: vfs_shadow_copy2. Implement symlinkat().
       via  2d50dfa52c8 s3: VFS: vfs_media_harmony. Implement symlinkat().
       via  ff3af0fccc8 s3: VFS: vfs_glusterfs. Implement symlinkat().
       via  29b69198790 s3: VFS: vfs_full_audit. Implement symlinkat().
       via  5665a3845a7 s3: VFS: vfs_ceph_snapshots. Implement symlinkat().
       via  4903c9fcfe6 s3: VFS: vfs_ceph. Implement symlinkat().
       via  f935989f2d4 s3: VFS: vfs_cap. Implement symlinkat().
       via  42414b5bfc8 s3: VFS: Add SMB_VFS_SYMLINKAT().
      from  3355601fe85 s3/4: libsmbclient test. Test using smbc_telldir/smbc_lseekdir with smbc_readdir/smbc_readdirplus/smbc_getdents.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c5ea3d045af491549346890929ac3dbbce952aeb
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:45:13 2019 -0700

    s3: VFS: Complete the replacement of SMB_VFS_SYMLINK() -> SMB_VFS_SYMLINKAT().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Sep  3 22:32:30 UTC 2019 on sn-devel-184

commit ea5a02e811060d674cb8603a30857161c00738df
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:39:53 2019 -0700

    s3: VFS: vfs_time_audit. Remove symlink_fn(). No longer used.
    
    NB, this will now fail smb_vfs_assert_all_fns()
    until we remove the symlink_fn() from the VFS definitions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 2fa1cd37c20ab9415d65659d0dd6e4c95e0ecca2
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:38:28 2019 -0700

    s3: VFS: vfs_full_audit. Remove symlink_fn(). No longer used.
    
    NB, this will now fail smb_vfs_assert_all_fns()
    until we remove the symlink_fn() from the VFS definitions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit a676e494cde2d533718836c4d443cfe0dd9f5aec
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:36:58 2019 -0700

    s3: VFS: vfs_unityed_media. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 8ef64494c6d779eac9a4441661ee56586d0d5764
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:36:10 2019 -0700

    s3: VFS: vfs_syncops. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit d492f4d1031a046989d5e141a6f05ff76de6f151
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:35:25 2019 -0700

    s3: VFS: vfs_snapper. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit a521377e200d2813eab661be22f520e1cf7cb12b
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:34:37 2019 -0700

    s3: VFS: vfs_shadow_copy2. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 9b3d3904c65b87746dda37dc73e2c30eb5ce30dd
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:33:22 2019 -0700

    s3: VFS: vfs_media_harmony. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit cb3b0ee853af916a18848b6c666ce55f1f1b6ec7
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:32:22 2019 -0700

    s3: VFS: vfs_glusterfs. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 33c00a61d83a938463b801476d714d4eef576079
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:31:02 2019 -0700

    s3: VFS: vfs_ceph_snapshots. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 1ee61e214a5b886af04209563348104cfe5a08a9
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:30:11 2019 -0700

    s3: VFS: vfs_ceph. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit d970556b682a5cb807b50ca83bb4ff1c36d2d423
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:29:27 2019 -0700

    s3: VFS: vfs_cap. Remove symlink_fn(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit daf78b0271aa1a4a3e21c077a9126aa3b6b7f859
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:16:41 2019 -0700

    s3: smbd: Change create_msdfs_link() to call SMB_VFS_SYMLINKAT().
    
    Use conn->cwd_fsp as current fsp.
    
    No logic change for now.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 538f78f07b6788f82dc93e17b5e8358a674d48a9
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:13:21 2019 -0700

    s3: smbd: Change smb_set_file_unix_link() to call SMB_VFS_SYMLINKAT().
    
    Use conn->cwd_fsp as current fsp.
    
    No logic change for now.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 1354f2f5210879466c706b8b2fb902bcef32da1f
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:10:47 2019 -0700

    s3: torture: Change cmd_symlink to call SMB_VFS_SYMLINKAT().
    
    Use conn->cwd_fsp as current fsp.
    
    No logic change for now.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 8c851da40f0482efc59b2d0e7f44e9d2b98d3d5c
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:02:53 2019 -0700

    s3: VFS: vfs_unityed_media. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit f6d63ff6446cd5423a61cb32204d4dc96a11ec34
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:01:33 2019 -0700

    s3: VFS: vfs_time_audit. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 4f5de7061eb53a5115223ca26279b320a15591c8
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 14:00:12 2019 -0700

    s3: VFS: vfs_syncops. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 787487ae3ee7adcd68931d5834dbfc5e3ba1dce3
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:54:52 2019 -0700

    s3: VFS: vfs_snapper. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit e033047559e77706401ef7c21f21187502d528b0
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:53:23 2019 -0700

    s3: VFS: vfs_shadow_copy2. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 2d50dfa52c8bac7f97eb95fef0a266e1fe9b1460
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:51:50 2019 -0700

    s3: VFS: vfs_media_harmony. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit ff3af0fccc8013862d75220bd60aa08ffe913d2a
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:49:57 2019 -0700

    s3: VFS: vfs_glusterfs. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 29b691987909aa31e30b73c6dc352ea4df9b646f
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:48:03 2019 -0700

    s3: VFS: vfs_full_audit. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 5665a3845a74d72d374ddfc3bea37b9fc4586b15
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:16:01 2019 -0700

    s3: VFS: vfs_ceph_snapshots. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 4903c9fcfe6eff17134f8bdeeaadb499eca271c1
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 13:13:51 2019 -0700

    s3: VFS: vfs_ceph. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit f935989f2d4a8ffe9df4fbdfbd9618eb89ab8ef2
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 12:54:23 2019 -0700

    s3: VFS: vfs_cap. Implement symlinkat().
    
    Currently identical to symlink().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

commit 42414b5bfc8f9e36d684b45997a5e9170b633220
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 30 12:01:13 2019 -0700

    s3: VFS: Add SMB_VFS_SYMLINKAT().
    
    Currently identical to SMB_VFS_SYMLINK().
    
    Next, add to all VFS modules that implement
    symlink and eventually remove symlink.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c            |  5 +++--
 examples/VFS/skel_transparent.c       | 10 +++++++---
 source3/include/smbprofile.h          |  1 +
 source3/include/vfs.h                 | 10 +++++++---
 source3/include/vfs_macros.h          |  8 ++++----
 source3/modules/vfs_cap.c             |  9 +++++----
 source3/modules/vfs_ceph.c            |  8 ++++++--
 source3/modules/vfs_ceph_snapshots.c  | 10 +++++++---
 source3/modules/vfs_default.c         | 16 +++++++++++-----
 source3/modules/vfs_full_audit.c      | 16 ++++++++++------
 source3/modules/vfs_glusterfs.c       | 10 ++++++----
 source3/modules/vfs_media_harmony.c   | 13 ++++++++-----
 source3/modules/vfs_not_implemented.c |  5 +++--
 source3/modules/vfs_shadow_copy2.c    | 11 +++++++----
 source3/modules/vfs_snapper.c         | 11 +++++++----
 source3/modules/vfs_syncops.c         | 11 ++++++++---
 source3/modules/vfs_time_audit.c      | 12 ++++++++----
 source3/modules/vfs_unityed_media.c   | 13 ++++++++-----
 source3/smbd/msdfs.c                  | 15 ++++++++++++---
 source3/smbd/trans2.c                 |  7 ++++++-
 source3/smbd/vfs.c                    | 12 ++++++++----
 source3/torture/cmd_vfs.c             |  7 ++++++-
 22 files changed, 148 insertions(+), 72 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index ecc1c920c92..5a18268e6f4 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -456,8 +456,9 @@ static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
 	return false;
 }
 
-static int skel_symlink(vfs_handle_struct *handle,
+static int skel_symlinkat(vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname)
 {
 	errno = ENOSYS;
@@ -1089,7 +1090,7 @@ 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,
 	.mknodat_fn = skel_mknodat,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 63cf4a4369a..654c0e6ca85 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -556,11 +556,15 @@ 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,
+static int skel_symlinkat(vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname)
 {
-	return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
+	return SMB_VFS_NEXT_SYMLINKAT(handle,
+				link_contents,
+				dirfsp,
+				new_smb_fname);
 }
 
 static int skel_vfs_readlinkat(vfs_handle_struct *handle,
@@ -1368,7 +1372,7 @@ 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,
 	.mknodat_fn = skel_mknodat,
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index b6c9002973e..51761e11040 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -84,6 +84,7 @@ struct tevent_context;
 	SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \
 	SMBPROFILE_STATS_BASIC(syscall_readlinkat) \
 	SMBPROFILE_STATS_BASIC(syscall_symlink) \
+	SMBPROFILE_STATS_BASIC(syscall_symlinkat) \
 	SMBPROFILE_STATS_BASIC(syscall_linkat) \
 	SMBPROFILE_STATS_BASIC(syscall_mknodat) \
 	SMBPROFILE_STATS_BASIC(syscall_realpath) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 126ba32aa36..6c741e09919 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -276,6 +276,7 @@
 /* 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 - Move SMB_VFS_SYMLINK -> SMB_VFS_SYMLINKAT. */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -795,8 +796,9 @@ 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,
+	int (*symlinkat_fn)(struct vfs_handle_struct *handle,
 				const char *link_contents,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname);
 	int (*readlinkat_fn)(struct vfs_handle_struct *handle,
 				struct files_struct *dirfsp,
@@ -1329,8 +1331,9 @@ 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,
+int smb_vfs_call_symlinkat(struct vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname);
 int smb_vfs_call_readlinkat(struct vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
@@ -1760,8 +1763,9 @@ 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,
+int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
 				const char *link_contents,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname);
 int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 247e9c286c7..c43a7e5a4b5 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -296,10 +296,10 @@
 #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) \
+	smb_vfs_call_symlinkat((handle)->next, (oldpath), (dirfsp), (newpath))
 
 #define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
 	smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index a942dd174a9..9999901056a 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -508,9 +508,9 @@ static int cap_ntimes(vfs_handle_struct *handle,
 	return ret;
 }
 
-
-static int cap_symlink(vfs_handle_struct *handle,
+static int cap_symlinkat(vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname)
 {
 	char *capold = capencode(talloc_tos(), link_contents);
@@ -534,8 +534,9 @@ static int cap_symlink(vfs_handle_struct *handle,
 		errno = ENOMEM;
 		return -1;
 	}
-	ret = SMB_VFS_NEXT_SYMLINK(handle,
+	ret = SMB_VFS_NEXT_SYMLINKAT(handle,
 			capold,
+			dirfsp,
 			new_cap_smb_fname);
 	if (ret == -1) {
 		saved_errno = errno;
@@ -1042,7 +1043,7 @@ static struct vfs_fn_pointers vfs_cap_fns = {
 	.lchown_fn = cap_lchown,
 	.chdir_fn = cap_chdir,
 	.ntimes_fn = cap_ntimes,
-	.symlink_fn = cap_symlink,
+	.symlinkat_fn = cap_symlinkat,
 	.readlinkat_fn = cap_readlinkat,
 	.linkat_fn = cap_linkat,
 	.mknodat_fn = cap_mknodat,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 74ca9c0a9aa..c873d8b9abe 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1128,14 +1128,18 @@ static int cephwrap_linux_setlease(struct vfs_handle_struct *handle, files_struc
 	return result;
 }
 
-static int cephwrap_symlink(struct vfs_handle_struct *handle,
+static int cephwrap_symlinkat(struct vfs_handle_struct *handle,
 		const char *link_target,
+		struct files_struct *dirfsp,
 		const struct smb_filename *new_smb_fname)
 {
 	int result = -1;
 	DBG_DEBUG("[CEPH] symlink(%p, %s, %s)\n", handle,
 			link_target,
 			new_smb_fname->base_name);
+
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
 	result = ceph_symlink(handle->data,
 			link_target,
 			new_smb_fname->base_name);
@@ -1462,7 +1466,7 @@ static struct vfs_fn_pointers ceph_fns = {
 	.kernel_flock_fn = cephwrap_kernel_flock,
 	.linux_setlease_fn = cephwrap_linux_setlease,
 	.getlock_fn = cephwrap_getlock,
-	.symlink_fn = cephwrap_symlink,
+	.symlinkat_fn = cephwrap_symlinkat,
 	.readlinkat_fn = cephwrap_readlinkat,
 	.linkat_fn = cephwrap_linkat,
 	.mknodat_fn = cephwrap_mknodat,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 93cd66c6253..3980067816d 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -795,8 +795,9 @@ static int ceph_snap_gmt_renameat(vfs_handle_struct *handle,
 }
 
 /* block links from writeable shares to snapshots for now, like other modules */
-static int ceph_snap_gmt_symlink(vfs_handle_struct *handle,
+static int ceph_snap_gmt_symlinkat(vfs_handle_struct *handle,
 				const char *link_contents,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname)
 {
 	int ret;
@@ -823,7 +824,10 @@ static int ceph_snap_gmt_symlink(vfs_handle_struct *handle,
 		errno = EROFS;
 		return -1;
 	}
-	return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
+	return SMB_VFS_NEXT_SYMLINKAT(handle,
+				link_contents,
+				dirfsp,
+				new_smb_fname);
 }
 
 static int ceph_snap_gmt_linkat(vfs_handle_struct *handle,
@@ -1624,7 +1628,7 @@ static struct vfs_fn_pointers ceph_snap_fns = {
 	.get_quota_fn = ceph_snap_gmt_get_quota,
 	.renameat_fn = ceph_snap_gmt_renameat,
 	.linkat_fn = ceph_snap_gmt_linkat,
-	.symlink_fn = ceph_snap_gmt_symlink,
+	.symlinkat_fn = ceph_snap_gmt_symlinkat,
 	.stat_fn = ceph_snap_gmt_stat,
 	.lstat_fn = ceph_snap_gmt_lstat,
 	.open_fn = ceph_snap_gmt_open,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 289ceab4266..bb7eba40df9 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2638,15 +2638,21 @@ static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
 	return result;
 }
 
-static int vfswrap_symlink(vfs_handle_struct *handle,
+static int vfswrap_symlinkat(vfs_handle_struct *handle,
 			const char *link_target,
+			struct files_struct *dirfsp,
 			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);
+	START_PROFILE(syscall_symlinkat);
+
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+	result = symlinkat(link_target,
+			dirfsp->fh->fd,
+			new_smb_fname->base_name);
+	END_PROFILE(syscall_symlinkat);
 	return result;
 }
 
@@ -3493,7 +3499,7 @@ 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,
 	.mknodat_fn = vfswrap_mknodat,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 2f74c4ccc4a..afdf779491f 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -151,7 +151,7 @@ typedef enum _vfs_op_type {
 	SMB_VFS_OP_KERNEL_FLOCK,
 	SMB_VFS_OP_LINUX_SETLEASE,
 	SMB_VFS_OP_GETLOCK,
-	SMB_VFS_OP_SYMLINK,
+	SMB_VFS_OP_SYMLINKAT,
 	SMB_VFS_OP_READLINKAT,
 	SMB_VFS_OP_LINKAT,
 	SMB_VFS_OP_MKNODAT,
@@ -294,7 +294,7 @@ static struct {
 	{ SMB_VFS_OP_KERNEL_FLOCK,	"kernel_flock" },
 	{ SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" },
 	{ SMB_VFS_OP_GETLOCK,	"getlock" },
-	{ SMB_VFS_OP_SYMLINK,	"symlink" },
+	{ SMB_VFS_OP_SYMLINKAT,	"symlinkat" },
 	{ SMB_VFS_OP_READLINKAT,"readlinkat" },
 	{ SMB_VFS_OP_LINKAT,	"linkat" },
 	{ SMB_VFS_OP_MKNODAT,	"mknodat" },
@@ -1725,15 +1725,19 @@ static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
 	return result;
 }
 
-static int smb_full_audit_symlink(vfs_handle_struct *handle,
+static int smb_full_audit_symlinkat(vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname)
 {
 	int result;
 
-	result = SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
+	result = SMB_VFS_NEXT_SYMLINKAT(handle,
+				link_contents,
+				dirfsp,
+				new_smb_fname);
 
-	do_log(SMB_VFS_OP_SYMLINK, (result >= 0), handle,
+	do_log(SMB_VFS_OP_SYMLINKAT, (result >= 0), handle,
 	       "%s|%s", link_contents, new_smb_fname->base_name);
 
 	return result;
@@ -2892,7 +2896,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
 	.kernel_flock_fn = smb_full_audit_kernel_flock,
 	.linux_setlease_fn = smb_full_audit_linux_setlease,
 	.getlock_fn = smb_full_audit_getlock,
-	.symlink_fn = smb_full_audit_symlink,
+	.symlinkat_fn = smb_full_audit_symlinkat,
 	.readlinkat_fn = smb_full_audit_readlinkat,
 	.linkat_fn = smb_full_audit_linkat,
 	.mknodat_fn = smb_full_audit_mknodat,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 38517b7af5a..6c941e56e2f 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1658,17 +1658,19 @@ static bool vfs_gluster_getlock(struct vfs_handle_struct *handle,
 	return true;
 }
 
-static int vfs_gluster_symlink(struct vfs_handle_struct *handle,
+static int vfs_gluster_symlinkat(struct vfs_handle_struct *handle,
 				const char *link_target,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname)
 {
 	int ret;
 
-	START_PROFILE(syscall_symlink);
+	START_PROFILE(syscall_symlinkat);
+	SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
 	ret = glfs_symlink(handle->data,
 			link_target,
 			new_smb_fname->base_name);
-	END_PROFILE(syscall_symlink);
+	END_PROFILE(syscall_symlinkat);
 
 	return ret;
 }
@@ -1932,7 +1934,7 @@ static struct vfs_fn_pointers glusterfs_fns = {
 	.kernel_flock_fn = vfs_gluster_kernel_flock,
 	.linux_setlease_fn = vfs_gluster_linux_setlease,
 	.getlock_fn = vfs_gluster_getlock,
-	.symlink_fn = vfs_gluster_symlink,
+	.symlinkat_fn = vfs_gluster_symlinkat,
 	.readlinkat_fn = vfs_gluster_readlinkat,
 	.linkat_fn = vfs_gluster_linkat,
 	.mknodat_fn = vfs_gluster_mknodat,
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c
index 56e2e4d8380..7e9df8a928d 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -1712,19 +1712,21 @@ out:
  * Failure: set errno, return -1
  */
 
-static int mh_symlink(vfs_handle_struct *handle,
+static int mh_symlinkat(vfs_handle_struct *handle,
 		const char *link_contents,
+		struct files_struct *dirfsp,
 		const struct smb_filename *new_smb_fname)
 {
 	int status = -1;
 	char *client_link_contents = NULL;
 	struct smb_filename *newclientFname = NULL;
 
-	DEBUG(MH_INFO_DEBUG, ("Entering mh_symlink\n"));
+	DEBUG(MH_INFO_DEBUG, ("Entering mh_symlinkat\n"));
 	if (!is_in_media_files(link_contents) &&
 			!is_in_media_files(new_smb_fname->base_name)) {
-		status = SMB_VFS_NEXT_SYMLINK(handle,
+		status = SMB_VFS_NEXT_SYMLINKAT(handle,
 				link_contents,
+				dirfsp,
 				new_smb_fname);
 		goto out;
 	}
@@ -1740,8 +1742,9 @@ static int mh_symlink(vfs_handle_struct *handle,
 		goto err;
 	}
 
-	status = SMB_VFS_NEXT_SYMLINK(handle,
+	status = SMB_VFS_NEXT_SYMLINKAT(handle,
 				client_link_contents,
+				dirfsp,
 				newclientFname);
 err:
 	TALLOC_FREE(client_link_contents);
@@ -2331,7 +2334,7 @@ static struct vfs_fn_pointers vfs_mh_fns = {
 	.lchown_fn = mh_lchown,
 	.chdir_fn = mh_chdir,
 	.ntimes_fn = mh_ntimes,
-	.symlink_fn = mh_symlink,
+	.symlinkat_fn = mh_symlinkat,
 	.readlinkat_fn = mh_readlinkat,
 	.linkat_fn = mh_linkat,
 	.mknodat_fn = mh_mknodat,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 34b84287d07..6009abd8d7e 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -454,8 +454,9 @@ bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
 	return false;
 }
 
-int vfs_not_implemented_symlink(vfs_handle_struct *handle,
+int vfs_not_implemented_symlinkat(vfs_handle_struct *handle,
 				const char *link_contents,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname)
 {
 	errno = ENOSYS;
@@ -1093,7 +1094,7 @@ 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,
 	.mknodat_fn = vfs_not_implemented_mknodat,
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 070ae06328b..c3fcc1f92eb 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -1184,9 +1184,9 @@ static int shadow_copy2_renameat(vfs_handle_struct *handle,
 			smb_fname_dst);
 }
 
-
-static int shadow_copy2_symlink(vfs_handle_struct *handle,
+static int shadow_copy2_symlinkat(vfs_handle_struct *handle,
 			const char *link_contents,
+			struct files_struct *dirfsp,
 			const struct smb_filename *new_smb_fname)
 {
 	time_t timestamp_old = 0;
@@ -1223,7 +1223,10 @@ static int shadow_copy2_symlink(vfs_handle_struct *handle,
 		errno = EROFS;
 		return -1;
 	}
-	return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
+	return SMB_VFS_NEXT_SYMLINKAT(handle,
+				link_contents,
+				dirfsp,
+				new_smb_fname);
 }
 
 static int shadow_copy2_linkat(vfs_handle_struct *handle,
@@ -3153,7 +3156,7 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
 	.get_quota_fn = shadow_copy2_get_quota,
 	.renameat_fn = shadow_copy2_renameat,
 	.linkat_fn = shadow_copy2_linkat,
-	.symlink_fn = shadow_copy2_symlink,
+	.symlinkat_fn = shadow_copy2_symlinkat,
 	.stat_fn = shadow_copy2_stat,
 	.lstat_fn = shadow_copy2_lstat,
 	.fstat_fn = shadow_copy2_fstat,
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index bf631ff25bc..79107b39997 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -2042,9 +2042,9 @@ static int snapper_gmt_renameat(vfs_handle_struct *handle,
 			smb_fname_dst);
 }
 
-
-static int snapper_gmt_symlink(vfs_handle_struct *handle,
+static int snapper_gmt_symlinkat(vfs_handle_struct *handle,
 				const char *link_contents,
+				struct files_struct *dirfsp,
 				const struct smb_filename *new_smb_fname)
 {
 	time_t timestamp_old = 0;
@@ -2068,7 +2068,10 @@ static int snapper_gmt_symlink(vfs_handle_struct *handle,
 		errno = EROFS;
 		return -1;
 	}
-	return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
+	return SMB_VFS_NEXT_SYMLINKAT(handle,
+			link_contents,
+			dirfsp,
+			new_smb_fname);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list