The branch, v4-19-test has been updated via b2d450cc697 smbd: Fix read_symlink_reparse() via fcbda8c7525 vfs_ceph: call 'ceph_fgetxattr' only if valid fd from 62c90dfa32e s3:auth: Allow 'Unix Users' and 'Unix Groups' to create a local token
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-19-test - Log ----------------------------------------------------------------- commit b2d450cc697550c676d4c85d0632f6d4bf043727 Author: Volker Lendecke <v...@samba.org> Date: Thu Oct 26 16:12:29 2023 +0200 smbd: Fix read_symlink_reparse() Bug: https://bugzilla.samba.org/show_bug.cgi?id=15505 Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Oct 27 21:19:35 UTC 2023 on atb-devel-224 (cherry picked from commit 952d6c2cf48b19807e96a49b95c19c224bd6e732) Autobuild-User(v4-19-test): Jule Anger <jan...@samba.org> Autobuild-Date(v4-19-test): Mon Dec 11 09:45:32 UTC 2023 on atb-devel-224 commit fcbda8c7525400fe85dde5b8edd1818a9d86f307 Author: Shachar Sharon <ssha...@redhat.com> Date: Thu Nov 16 11:57:02 2023 +0200 vfs_ceph: call 'ceph_fgetxattr' only if valid fd Align getxattr logic with the rest of xattr hooks: call ceph_fgetxattr with appropriate io-fd when 'is_pathref' is false; otherwise, call ceph_getxattr. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15440 Signed-off-by: Shachar Sharon <ssha...@redhat.com> Reviewed-by: Anoop C S <anoo...@redhat.com> Reviewed-by: Guenther Deschner <g...@samba.org> Autobuild-User(master): Günther Deschner <g...@samba.org> Autobuild-Date(master): Thu Nov 30 12:32:29 UTC 2023 on atb-devel-224 (cherry picked from commit 83edfcff5ccd8c4c710576b6d5612e0578d168c8) ----------------------------------------------------------------------- Summary of changes: source3/modules/vfs_ceph.c | 27 ++++++++++++++++++++++++--- source3/smbd/files.c | 14 +++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index d7772c62119..353183fa0bb 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -1414,11 +1414,32 @@ static const char *cephwrap_connectpath( Extended attribute operations. *****************************************************************/ -static ssize_t cephwrap_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size) +static ssize_t cephwrap_fgetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, + const char *name, + void *value, + size_t size) { int ret; - DBG_DEBUG("[CEPH] fgetxattr(%p, %p, %s, %p, %llu)\n", handle, fsp, name, value, llu(size)); - ret = ceph_fgetxattr(handle->data, fsp_get_io_fd(fsp), name, value, size); + DBG_DEBUG("[CEPH] fgetxattr(%p, %p, %s, %p, %llu)\n", + handle, + fsp, + name, + value, + llu(size)); + if (!fsp->fsp_flags.is_pathref) { + ret = ceph_fgetxattr(handle->data, + fsp_get_io_fd(fsp), + name, + value, + size); + } else { + ret = ceph_getxattr(handle->data, + fsp->fsp_name->base_name, + name, + value, + size); + } DBG_DEBUG("[CEPH] fgetxattr(...) = %d\n", ret); if (ret < 0) { WRAP_RETURN(ret); diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 9dcab463d3b..b8640fd6677 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -754,11 +754,19 @@ NTSTATUS read_symlink_reparse( } if (symlink->substitute_name[0] == '/') { - const char *connectpath = dirfsp->conn->connectpath; + char *subdir_path = NULL; char *abs_target_canon = NULL; const char *relative = NULL; bool in_share; + subdir_path = talloc_asprintf(talloc_tos(), + "%s/%s", + dirfsp->conn->connectpath, + dirfsp->fsp_name->base_name); + if (subdir_path == NULL) { + goto nomem; + } + abs_target_canon = canonicalize_absolute_path(talloc_tos(), symlink->substitute_name); @@ -766,8 +774,8 @@ NTSTATUS read_symlink_reparse( goto nomem; } - in_share = subdir_of(connectpath, - strlen(connectpath), + in_share = subdir_of(subdir_path, + strlen(subdir_path), abs_target_canon, &relative); if (in_share) { -- Samba Shared Repository