[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Aug 23 20:07:02 UTC 2019
The branch, master has been updated
via 9b4685242fc s3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().
via 5333ac35dde s3: VFS: vfs_time_audit. Remove readlink_fn(). No longer used.
via 021da2f1522 s3: VFS: vfs_full_audit. Remove readlink_fn(). No longer used.
via 58bce531fbf s3: VFS: vfs_unityed_media. Remove readlink_fn(). No longer used.
via 79ac8e9ecab s3: VFS: vfs_snapper. Remove readlink_fn(). No longer used.
via bc55a552b02 s3: VFS: vfs_shadow_copy2. Remove readlink_fn(). No longer used.
via 65deb57c01d s3: VFS: vfs_media_harmony. Remove readlink_fn(). No longer used.
via f7f2572a233 s3: VFS: vfs_glusterfs. Remove readlink_fn(). No longer used.
via 5fe9845b313 s3: VFS: vfs_expand_msdfs. Remove readlink_fn(). No longer used.
via 0f160428c4b s3: VFS: vfs_ceph_snapshots. Remove readlink_fn(). No longer used.
via 1d1cef7331e s3: VFS: vfs_ceph. Remove readlink_fn(). No longer used.
via 9ffa8c84620 s3: VFS: vfs_cap. Remove readlink_fn(). No longer used.
via 406bde26545 s3: smbd: Change process_symlink_open() to call SMB_VFS_READLINKAT().
via 288fbe35993 s3: smbd: Change smbd_do_qfilepathinfo(): case SMB_QUERY_FILE_UNIX_LINK: to call SMB_VFS_READLINKAT().
via 654469740c7 s3: smbd: Change is_msdfs_link_internal() to call SMB_VFS_READLINKAT().
via 4684e2c9270 s3: torture: Change cmd_readlink to call SMB_VFS_READLINKAT().
via 6f1c0d43177 s3: VFS: vfs_unityed_media. Implement readlinkat().
via 854320cd5df s3: VFS: vfs_time_audit. Implement readlinkat().
via eef38b05092 s3: VFS: vfs_snapper. Implement readlinkat().
via 06609f3ada9 s3: VFS: vfs_shadow_copy2. Implement readlinkat().
via 44c955a81ad s3: VFS: vfs_media_harmony. Implement readlinkat().
via 4874730c305 s3: VFS: vfs_glusterfs. Implement readlinkat().
via 3bdb77ad790 s3: VFS: vfs_full_audit. Implement readlinkat().
via de17e762ead s3: VFS: vfs_expand_msdfs. Implement readlinkat().
via b692b2916de s3: VFS: vfs_ceph_snapshots. Implement readlinkat().
via e386ddb6a7a s3: VFS: vfs_ceph. Implement readlinkat().
via 885d804c91a s3: VFS: vfs_cap. Implement readlinkat().
via 515c062b9e6 s3: VFS: Add SMB_VFS_READLINKAT().
from d8863dd8cb7 vfs_glusterfs: Use pthreadpool for scheduling aio operations
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9b4685242fc7aeeae05d50566b428fc003848365
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:59:05 2019 -0700
s3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().
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): Fri Aug 23 20:06:22 UTC 2019 on sn-devel-184
commit 5333ac35dde2b904ac520ac80eee54042c33b39f
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:53:25 2019 -0700
s3: VFS: vfs_time_audit. Remove readlink_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 021da2f1522b373afeb20350ab2f86aae6f785e6
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:52:43 2019 -0700
s3: VFS: vfs_full_audit. Remove readlink_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 58bce531fbf2d1d52055520f86d3ac2eabdd1eb0
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:51:17 2019 -0700
s3: VFS: vfs_unityed_media. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 79ac8e9ecab7b9eeb07a58830cb3569faa41778b
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:50:42 2019 -0700
s3: VFS: vfs_snapper. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit bc55a552b02d7659efcafd5672fd0fe5aa8dd912
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:49:54 2019 -0700
s3: VFS: vfs_shadow_copy2. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 65deb57c01d7649920654b7906c40d0a6c26ec40
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:49:08 2019 -0700
s3: VFS: vfs_media_harmony. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit f7f2572a23324fdcc6aa9209332a1af995421465
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:48:17 2019 -0700
s3: VFS: vfs_glusterfs. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 5fe9845b313090aa4db8cc12f74a13af87dc92bb
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:47:30 2019 -0700
s3: VFS: vfs_expand_msdfs. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 0f160428c4b8481196a08ef4d77519af90b99d27
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:46:40 2019 -0700
s3: VFS: vfs_ceph_snapshots. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 1d1cef7331ede3ffe4f06435e3100157449b2a5f
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:44:41 2019 -0700
s3: VFS: vfs_ceph. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 9ffa8c846201fe8dc8a80c9a7dae90e6677188ee
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:43:53 2019 -0700
s3: VFS: vfs_cap. Remove readlink_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 406bde26545ef3d86bf19319b60262ee2c13825b
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:41:27 2019 -0700
s3: smbd: Change process_symlink_open() to call SMB_VFS_READLINKAT().
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 288fbe35993375bcfc5f0191185abf61621b06b9
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:39:56 2019 -0700
s3: smbd: Change smbd_do_qfilepathinfo(): case SMB_QUERY_FILE_UNIX_LINK: to call SMB_VFS_READLINKAT().
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 654469740c7763c3c7a1ace6da0a68ea37682fa1
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:38:01 2019 -0700
s3: smbd: Change is_msdfs_link_internal() to call SMB_VFS_READLINKAT().
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 4684e2c9270291c664c83099104e5178203265ef
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:34:13 2019 -0700
s3: torture: Change cmd_readlink to call SMB_VFS_READLINKAT().
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 6f1c0d43177bb050042e808c6c2acc4e3bdddb78
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:31:29 2019 -0700
s3: VFS: vfs_unityed_media. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 854320cd5df93f430cf8a51b1924aa9cd2d5e135
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:29:45 2019 -0700
s3: VFS: vfs_time_audit. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit eef38b05092771f496f6614456a797848da474aa
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:28:26 2019 -0700
s3: VFS: vfs_snapper. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 06609f3ada9a4c8fe830e8b01d4ada2dcc640523
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:26:47 2019 -0700
s3: VFS: vfs_shadow_copy2. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 44c955a81ada0f513230653f35f0d6a0dd6d7404
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:24:49 2019 -0700
s3: VFS: vfs_media_harmony. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 4874730c3052668a1bc8b8939ee557a77387f1f0
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:22:55 2019 -0700
s3: VFS: vfs_glusterfs. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 3bdb77ad790961f6f1df41a088e3b40b0b507e87
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:21:23 2019 -0700
s3: VFS: vfs_full_audit. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit de17e762eadc49f565d4495b716da9f0f9837cee
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:18:16 2019 -0700
s3: VFS: vfs_expand_msdfs. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit b692b2916de1af02ee6f56c194a0436ec0fe01c0
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 14:10:31 2019 -0700
s3: VFS: vfs_ceph_snapshots. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit e386ddb6a7ab6f4e0dec3f7d44431e2cb8b136da
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 13:51:28 2019 -0700
s3: VFS: vfs_ceph. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 885d804c91ada945cf4c7d721cf08f55952f6e0b
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 13:49:28 2019 -0700
s3: VFS: vfs_cap. Implement readlinkat().
Currently identical to readlink().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ralph Böhme <slow at samba.org>
commit 515c062b9e67a9f7016bcce3a02b75ab6d61385d
Author: Jeremy Allison <jra at samba.org>
Date: Thu Aug 22 13:42:26 2019 -0700
s3: VFS: Add SMB_VFS_READLINKAT().
Currently identical to SMB_VFS_READLINK().
Next, add to all VFS modules that implement
readlink and eventually remove readlink.
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 | 11 ++++++++---
source3/include/smbprofile.h | 2 +-
source3/include/vfs.h | 16 ++++++++++------
source3/include/vfs_macros.h | 8 ++++----
source3/modules/vfs_cap.c | 11 ++++++++---
source3/modules/vfs_ceph.c | 8 ++++++--
source3/modules/vfs_ceph_snapshots.c | 17 +++++++++++++----
source3/modules/vfs_default.c | 18 +++++++++++++-----
source3/modules/vfs_expand_msdfs.c | 12 ++++++++----
source3/modules/vfs_full_audit.c | 17 +++++++++++------
source3/modules/vfs_glusterfs.c | 10 ++++++----
source3/modules/vfs_media_harmony.c | 20 +++++++++++++++-----
source3/modules/vfs_not_implemented.c | 11 ++++++-----
source3/modules/vfs_shadow_copy2.c | 17 +++++++++++++----
source3/modules/vfs_snapper.c | 17 +++++++++++++----
source3/modules/vfs_time_audit.c | 14 +++++++++-----
source3/modules/vfs_unityed_media.c | 20 ++++++++++++++------
source3/smbd/msdfs.c | 8 ++++++--
source3/smbd/open.c | 3 ++-
source3/smbd/trans2.c | 9 ++++++---
source3/smbd/vfs.c | 11 ++++++++---
source3/torture/cmd_vfs.c | 9 +++++++--
23 files changed, 190 insertions(+), 84 deletions(-)
Changeset truncated at 500 lines:
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 48d8e3df7f6..ecc1c920c92 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -464,7 +464,8 @@ static int skel_symlink(vfs_handle_struct *handle,
return -1;
}
-static int skel_vfs_readlink(vfs_handle_struct *handle,
+static int skel_vfs_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
@@ -1089,7 +1090,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.symlink_fn = skel_symlink,
- .readlink_fn = skel_vfs_readlink,
+ .readlinkat_fn = skel_vfs_readlinkat,
.linkat_fn = skel_linkat,
.mknodat_fn = skel_mknodat,
.realpath_fn = skel_realpath,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index ab43118ce37..63cf4a4369a 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -563,12 +563,17 @@ static int skel_symlink(vfs_handle_struct *handle,
return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
}
-static int skel_vfs_readlink(vfs_handle_struct *handle,
+static int skel_vfs_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
{
- return SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
+ return SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ smb_fname,
+ buf,
+ bufsiz);
}
static int skel_linkat(vfs_handle_struct *handle,
@@ -1364,7 +1369,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.linux_setlease_fn = skel_linux_setlease,
.getlock_fn = skel_getlock,
.symlink_fn = skel_symlink,
- .readlink_fn = skel_vfs_readlink,
+ .readlinkat_fn = skel_vfs_readlinkat,
.linkat_fn = skel_linkat,
.mknodat_fn = skel_mknodat,
.realpath_fn = skel_realpath,
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 048ce8504cd..b6c9002973e 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -82,7 +82,7 @@ struct tevent_context;
SMBPROFILE_STATS_BASIC(syscall_kernel_flock) \
SMBPROFILE_STATS_BASIC(syscall_linux_setlease) \
SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \
- SMBPROFILE_STATS_BASIC(syscall_readlink) \
+ SMBPROFILE_STATS_BASIC(syscall_readlinkat) \
SMBPROFILE_STATS_BASIC(syscall_symlink) \
SMBPROFILE_STATS_BASIC(syscall_linkat) \
SMBPROFILE_STATS_BASIC(syscall_mknodat) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 3463b574e5b..126ba32aa36 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -275,6 +275,7 @@
/* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */
/* 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. */
#define SMB_VFS_INTERFACE_VERSION 42
@@ -797,7 +798,8 @@ struct vfs_fn_pointers {
int (*symlink_fn)(struct vfs_handle_struct *handle,
const char *link_contents,
const struct smb_filename *new_smb_fname);
- int (*readlink_fn)(struct vfs_handle_struct *handle,
+ int (*readlinkat_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz);
@@ -1330,7 +1332,8 @@ bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
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_readlink(struct vfs_handle_struct *handle,
+int smb_vfs_call_readlinkat(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz);
@@ -1760,10 +1763,11 @@ bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
int vfs_not_implemented_symlink(vfs_handle_struct *handle,
const char *link_contents,
const struct smb_filename *new_smb_fname);
-int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- char *buf,
- size_t bufsiz);
+int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ char *buf,
+ size_t bufsiz);
int vfs_not_implemented_linkat(vfs_handle_struct *handle,
struct files_struct *srcfsp,
const struct smb_filename *old_smb_fname,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 0f317ecbe31..247e9c286c7 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -301,10 +301,10 @@
#define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) \
smb_vfs_call_symlink((handle)->next, (oldpath), (newpath))
-#define SMB_VFS_READLINK(conn, smb_fname, buf, bufsiz) \
- smb_vfs_call_readlink((conn)->vfs_handles, (smb_fname), (buf), (bufsiz))
-#define SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz) \
- smb_vfs_call_readlink((handle)->next, (smb_fname), (buf), (bufsiz))
+#define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
+ smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
+#define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
+ smb_vfs_call_readlinkat((handle)->next, (dirfsp), (smb_fname), (buf), (bufsiz))
#define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \
smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags))
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 4a5992f8af6..a942dd174a9 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -549,7 +549,8 @@ static int cap_symlink(vfs_handle_struct *handle,
return ret;
}
-static int cap_readlink(vfs_handle_struct *handle,
+static int cap_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
@@ -573,7 +574,11 @@ static int cap_readlink(vfs_handle_struct *handle,
errno = ENOMEM;
return -1;
}
- ret = SMB_VFS_NEXT_READLINK(handle, cap_smb_fname, buf, bufsiz);
+ ret = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ cap_smb_fname,
+ buf,
+ bufsiz);
if (ret == -1) {
saved_errno = errno;
}
@@ -1038,7 +1043,7 @@ static struct vfs_fn_pointers vfs_cap_fns = {
.chdir_fn = cap_chdir,
.ntimes_fn = cap_ntimes,
.symlink_fn = cap_symlink,
- .readlink_fn = cap_readlink,
+ .readlinkat_fn = cap_readlinkat,
.linkat_fn = cap_linkat,
.mknodat_fn = cap_mknodat,
.realpath_fn = cap_realpath,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 4ccadae0e5c..74ca9c0a9aa 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1143,7 +1143,8 @@ static int cephwrap_symlink(struct vfs_handle_struct *handle,
WRAP_RETURN(result);
}
-static int cephwrap_readlink(struct vfs_handle_struct *handle,
+static int cephwrap_readlinkat(struct vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
@@ -1151,6 +1152,9 @@ static int cephwrap_readlink(struct vfs_handle_struct *handle,
int result = -1;
DBG_DEBUG("[CEPH] readlink(%p, %s, %p, %llu)\n", handle,
smb_fname->base_name, buf, llu(bufsiz));
+
+ SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
result = ceph_readlink(handle->data, smb_fname->base_name, buf, bufsiz);
DBG_DEBUG("[CEPH] readlink(...) = %d\n", result);
WRAP_RETURN(result);
@@ -1459,7 +1463,7 @@ static struct vfs_fn_pointers ceph_fns = {
.linux_setlease_fn = cephwrap_linux_setlease,
.getlock_fn = cephwrap_getlock,
.symlink_fn = cephwrap_symlink,
- .readlink_fn = cephwrap_readlink,
+ .readlinkat_fn = cephwrap_readlinkat,
.linkat_fn = cephwrap_linkat,
.mknodat_fn = cephwrap_mknodat,
.realpath_fn = cephwrap_realpath,
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index ff412ee9a6c..93cd66c6253 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -1093,7 +1093,8 @@ static int ceph_snap_gmt_ntimes(vfs_handle_struct *handle,
return SMB_VFS_NEXT_NTIMES(handle, csmb_fname, ft);
}
-static int ceph_snap_gmt_readlink(vfs_handle_struct *handle,
+static int ceph_snap_gmt_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *csmb_fname,
char *buf,
size_t bufsiz)
@@ -1113,7 +1114,11 @@ static int ceph_snap_gmt_readlink(vfs_handle_struct *handle,
return -1;
}
if (timestamp == 0) {
- return SMB_VFS_NEXT_READLINK(handle, csmb_fname, buf, bufsiz);
+ return SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ csmb_fname,
+ buf,
+ bufsiz);
}
ret = ceph_snap_gmt_convert(handle, stripped,
timestamp, conv, sizeof(conv));
@@ -1128,7 +1133,11 @@ static int ceph_snap_gmt_readlink(vfs_handle_struct *handle,
}
new_fname->base_name = conv;
- ret = SMB_VFS_NEXT_READLINK(handle, new_fname, buf, bufsiz);
+ ret = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ new_fname,
+ buf,
+ bufsiz);
saved_errno = errno;
TALLOC_FREE(new_fname);
errno = saved_errno;
@@ -1624,7 +1633,7 @@ static struct vfs_fn_pointers ceph_snap_fns = {
.chown_fn = ceph_snap_gmt_chown,
.chdir_fn = ceph_snap_gmt_chdir,
.ntimes_fn = ceph_snap_gmt_ntimes,
- .readlink_fn = ceph_snap_gmt_readlink,
+ .readlinkat_fn = ceph_snap_gmt_readlinkat,
.mknodat_fn = ceph_snap_gmt_mknodat,
.realpath_fn = ceph_snap_gmt_realpath,
.get_nt_acl_fn = ceph_snap_gmt_get_nt_acl,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 51928fd0b04..289ceab4266 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2650,16 +2650,24 @@ static int vfswrap_symlink(vfs_handle_struct *handle,
return result;
}
-static int vfswrap_readlink(vfs_handle_struct *handle,
+static int vfswrap_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
{
int result;
- START_PROFILE(syscall_readlink);
- result = readlink(smb_fname->base_name, buf, bufsiz);
- END_PROFILE(syscall_readlink);
+ START_PROFILE(syscall_readlinkat);
+
+ SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+ result = readlinkat(dirfsp->fh->fd,
+ smb_fname->base_name,
+ buf,
+ bufsiz);
+
+ END_PROFILE(syscall_readlinkat);
return result;
}
@@ -3486,7 +3494,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
.linux_setlease_fn = vfswrap_linux_setlease,
.getlock_fn = vfswrap_getlock,
.symlink_fn = vfswrap_symlink,
- .readlink_fn = vfswrap_readlink,
+ .readlinkat_fn = vfswrap_readlinkat,
.linkat_fn = vfswrap_linkat,
.mknodat_fn = vfswrap_mknodat,
.realpath_fn = vfswrap_realpath,
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index 598da08c0c8..0923489f265 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -180,7 +180,8 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx,
return new_target;
}
-static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
+static int expand_msdfs_readlinkat(struct vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
@@ -199,8 +200,11 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
return -1;
}
- result = SMB_VFS_NEXT_READLINK(handle, smb_fname, target,
- PATH_MAX);
+ result = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ smb_fname,
+ target,
+ PATH_MAX);
if (result <= 0)
return result;
@@ -225,7 +229,7 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
}
static struct vfs_fn_pointers vfs_expand_msdfs_fns = {
- .readlink_fn = expand_msdfs_readlink
+ .readlinkat_fn = expand_msdfs_readlinkat
};
static_decl_vfs;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 4bf3c483722..2f74c4ccc4a 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -152,7 +152,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_LINUX_SETLEASE,
SMB_VFS_OP_GETLOCK,
SMB_VFS_OP_SYMLINK,
- SMB_VFS_OP_READLINK,
+ SMB_VFS_OP_READLINKAT,
SMB_VFS_OP_LINKAT,
SMB_VFS_OP_MKNODAT,
SMB_VFS_OP_REALPATH,
@@ -295,7 +295,7 @@ static struct {
{ SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" },
{ SMB_VFS_OP_GETLOCK, "getlock" },
{ SMB_VFS_OP_SYMLINK, "symlink" },
- { SMB_VFS_OP_READLINK, "readlink" },
+ { SMB_VFS_OP_READLINKAT,"readlinkat" },
{ SMB_VFS_OP_LINKAT, "linkat" },
{ SMB_VFS_OP_MKNODAT, "mknodat" },
{ SMB_VFS_OP_REALPATH, "realpath" },
@@ -1739,16 +1739,21 @@ static int smb_full_audit_symlink(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_readlink(vfs_handle_struct *handle,
+static int smb_full_audit_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
{
int result;
- result = SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
+ result = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ smb_fname,
+ buf,
+ bufsiz);
- do_log(SMB_VFS_OP_READLINK, (result >= 0), handle, "%s",
+ do_log(SMB_VFS_OP_READLINKAT, (result >= 0), handle, "%s",
smb_fname->base_name);
return result;
@@ -2888,7 +2893,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.linux_setlease_fn = smb_full_audit_linux_setlease,
.getlock_fn = smb_full_audit_getlock,
.symlink_fn = smb_full_audit_symlink,
- .readlink_fn = smb_full_audit_readlink,
+ .readlinkat_fn = smb_full_audit_readlinkat,
.linkat_fn = smb_full_audit_linkat,
.mknodat_fn = smb_full_audit_mknodat,
.realpath_fn = smb_full_audit_realpath,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 66a3e9d9db8..38517b7af5a 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1673,16 +1673,18 @@ static int vfs_gluster_symlink(struct vfs_handle_struct *handle,
return ret;
}
-static int vfs_gluster_readlink(struct vfs_handle_struct *handle,
+static int vfs_gluster_readlinkat(struct vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
{
int ret;
- START_PROFILE(syscall_readlink);
+ START_PROFILE(syscall_readlinkat);
+ SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
ret = glfs_readlink(handle->data, smb_fname->base_name, buf, bufsiz);
- END_PROFILE(syscall_readlink);
+ END_PROFILE(syscall_readlinkat);
return ret;
}
@@ -1931,7 +1933,7 @@ static struct vfs_fn_pointers glusterfs_fns = {
.linux_setlease_fn = vfs_gluster_linux_setlease,
.getlock_fn = vfs_gluster_getlock,
.symlink_fn = vfs_gluster_symlink,
- .readlink_fn = vfs_gluster_readlink,
+ .readlinkat_fn = vfs_gluster_readlinkat,
.linkat_fn = vfs_gluster_linkat,
.mknodat_fn = vfs_gluster_mknodat,
.realpath_fn = vfs_gluster_realpath,
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c
index 1b1a6606056..56e2e4d8380 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -1754,7 +1754,8 @@ out:
* Success: return byte count
* Failure: set errno, return -1
*/
-static int mh_readlink(vfs_handle_struct *handle,
+static int mh_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz)
@@ -1762,9 +1763,13 @@ static int mh_readlink(vfs_handle_struct *handle,
int status;
struct smb_filename *clientFname = NULL;
- DEBUG(MH_INFO_DEBUG, ("Entering mh_readlink\n"));
+ DEBUG(MH_INFO_DEBUG, ("Entering mh_readlinkat\n"));
if (!is_in_media_files(smb_fname->base_name)) {
- status = SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
+ status = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ smb_fname,
+ buf,
+ bufsiz);
goto out;
}
@@ -1774,7 +1779,12 @@ static int mh_readlink(vfs_handle_struct *handle,
goto err;
}
- status = SMB_VFS_NEXT_READLINK(handle, clientFname, buf, bufsiz);
+ status = SMB_VFS_NEXT_READLINKAT(handle,
+ dirfsp,
+ clientFname,
+ buf,
+ bufsiz);
+
err:
TALLOC_FREE(clientFname);
out:
@@ -2322,7 +2332,7 @@ static struct vfs_fn_pointers vfs_mh_fns = {
.chdir_fn = mh_chdir,
.ntimes_fn = mh_ntimes,
.symlink_fn = mh_symlink,
- .readlink_fn = mh_readlink,
+ .readlinkat_fn = mh_readlinkat,
.linkat_fn = mh_linkat,
.mknodat_fn = mh_mknodat,
.realpath_fn = mh_realpath,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 02d36ecbaa4..34b84287d07 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -462,10 +462,11 @@ int vfs_not_implemented_symlink(vfs_handle_struct *handle,
return -1;
}
-int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- char *buf,
- size_t bufsiz)
+int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
+ files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ char *buf,
+ size_t bufsiz)
{
errno = ENOSYS;
return -1;
@@ -1093,7 +1094,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
.linux_setlease_fn = vfs_not_implemented_linux_setlease,
.getlock_fn = vfs_not_implemented_getlock,
--
Samba Shared Repository
More information about the samba-cvs
mailing list