[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Thu Mar 11 18:59:01 UTC 2021
The branch, master has been updated
via 9c682d794e6 Update status of SMB_VFS_SETXATTR
via 82e14026360 VFS: Remove SMB_VFS_SETXATTR, no longer used
via 48d18f451ec s3/modules: snapper: Add missing fsetxattr_fn impl
via fabfe6fbe58 s3/modules: shadow_copy2: Add new fsetxattr_fn implementation
via a7d81d8e279 s3/modules: ceph_snapshots: Add missing fsetxattr_fn implementation
via a7e2ecca855 s2/modules: nfs4acl_smb4acl_set_fn SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FFSETXATTR
via b9efb0a5947 s3/modules: fake_acls_lchown use SMB_VFS_NEXT_FSET
via 40a376e1881 s3/modules: fake_acls: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
via e592cb8dcb5 s3/lib: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
via 1a8b3844403 s3/torture: SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 1fd550f2b4c s3/modules: stream_dir make sure mark_file_valid is called with fsp
via 055e87233e2 s3/modules: streams_xattr_renameat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 86d645a71b0 s3/modules: streams_xattr: Fix fname passed to SETXATTR
via ee4afd5955c s3/modules: streams_xattr_ftruncate SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via c02cdcd5fb9 s3/modules: streams_xattr_pwrite SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 147183e24a6 streams_xattr_openat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 17054bfa9f7 s3/modules: vfs_acl_xattr SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 6427753864b s3/smbd: Detect and fail attempt to set_ea_dos_attribute on link
via 221573de213 s3/smbd: SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
via 4031206478e s3/smbd: set_create_timespec_ea should create smb_fname with valid fsp
via b05b13ccec8 s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
via 470b6223e72 s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
via 73a46ac9f34 s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
via 14564477d55 s3/modules: ensure catia_set_dos_attributes passes on pathref
via 0f0b945c1aa s3/smbd: posix_acls SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via a241e9b3d43 s3/modules: posixacl convert from SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
via 6b725386992 s3/lib: adouble SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
via ecd83a5877e s3/smbd: set_ea SMB_VFS_FSETXATTR => SMB_VFS_FSETXATTR
from 0e789ba1802 idmap_nss: Do not return SID from unixids_to_sids on type mismatch
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9c682d794e6cf678991a5de1a671764462ea458e
Author: Noel Power <noel.power at suse.com>
Date: Mon Mar 1 15:22:32 2021 +0000
Update status of SMB_VFS_SETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Mar 11 18:58:46 UTC 2021 on sn-devel-184
commit 82e1402636015f5109aedda41318e5d67b988941
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 10:39:49 2021 +0000
VFS: Remove SMB_VFS_SETXATTR, no longer used
---------------
/ \
/ REST \
/ IN \
/ PEACE \
/ \
| |
| SMB_VFS_SETXATTR |
| |
| |
| 19 February |
| 2021 |
| |
| |
*| * * * | *
_________)/\\_//(\/(/\)/\//\/\////|_)_______
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Noel Power <noel.power at suse.com>
commit 48d18f451ec2521b8af9883feff965b6c523438e
Author: Noel Power <noel.power at suse.com>
Date: Wed Mar 10 09:24:04 2021 +0000
s3/modules: snapper: Add missing fsetxattr_fn impl
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit fabfe6fbe58dc2c3d8c7615165ec7c7933e4e9cd
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 15:03:01 2021 +0000
s3/modules: shadow_copy2: Add new fsetxattr_fn implementation
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a7d81d8e27900a93f56b76e95063b998bdda9bc6
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 14:51:14 2021 +0000
s3/modules: ceph_snapshots: Add missing fsetxattr_fn implementation
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a7e2ecca8559eac524f32f4306859a2773da3b61
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 14:47:07 2021 +0000
s2/modules: nfs4acl_smb4acl_set_fn SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FFSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b9efb0a5947148910c86127725b5add6d85bd810
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 16:21:58 2021 +0000
s3/modules: fake_acls_lchown use SMB_VFS_NEXT_FSET
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 40a376e18817a53f5c86b6729e2c17122ec20f46
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 13:35:04 2021 +0000
s3/modules: fake_acls: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
Ensure fake_acls_sys_acl_set_file gets properly setup smb_filename
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e592cb8dcb51ec35efa2e71a77b5a944413e56b6
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 12:43:00 2021 +0000
s3/lib: SMB_VFS_NEXT_SETXATTR -> SMB_VFS_NEXT_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1a8b384440339fcc03b86d8dd4be95c27ffaef6c
Author: Noel Power <noel.power at suse.com>
Date: Fri Feb 19 09:17:57 2021 +0000
s3/torture: SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1fd550f2b4c081bc59455ec15fab9c3cfce9879f
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 21:13:07 2021 +0000
s3/modules: stream_dir make sure mark_file_valid is called with fsp
can we get this further up the call path ???
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 055e87233e23387641caf185a18b147d97bb4631
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 20:18:46 2021 +0000
s3/modules: streams_xattr_renameat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 86d645a71b046504f5cc3528ae5b34fcdeb1cad2
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 19:34:15 2021 +0000
s3/modules: streams_xattr: Fix fname passed to SETXATTR
we see to be overwritting the 'old' stream, this change fixes it
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ee4afd5955cf5a96180119e5b50ea803c5a43d48
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 18:56:56 2021 +0000
s3/modules: streams_xattr_ftruncate SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit c02cdcd5fb9c0a79bcefa7dbe4e07c407ff8052a
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 18:14:16 2021 +0000
s3/modules: streams_xattr_pwrite SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 147183e24a669dc97315bb21cfef62fea3484d1e
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 17:04:24 2021 +0000
streams_xattr_openat SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 17054bfa9f7f3feeb00125fe2073317051fdc500
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 14:46:54 2021 +0000
s3/modules: vfs_acl_xattr SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 6427753864b82b649baabcbf5c7cb6d4065b6d01
Author: Noel Power <noel.power at suse.com>
Date: Wed Mar 10 09:12:37 2021 +0000
s3/smbd: Detect and fail attempt to set_ea_dos_attribute on link
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 221573de2133b75df43ef4879438f41de8b40446
Author: Noel Power <noel.power at suse.com>
Date: Wed Feb 17 09:27:40 2021 +0000
s3/smbd: SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4031206478eb9d5fc23630fb9ce7e6d08771c72d
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 10:54:23 2021 +0000
s3/smbd: set_create_timespec_ea should create smb_fname with valid fsp
we need to call file_set_dosmode (which ends up calling
SMB_VFS_FSETXATTR via set_ea_dos_attribute) has smb_fname set up
with a valid smb_fname->fsp
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b05b13ccec89496eae5ad29ab9e42c3ea7bedaed
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 11:05:34 2021 +0000
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 470b6223e7283ce1308e0b273eb893d20ab72d5b
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 11:04:55 2021 +0000
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 73a46ac9f348eb4cf1bab462f9c71c9cea4ce955
Author: Noel Power <noel.power at suse.com>
Date: Thu Feb 18 11:01:10 2021 +0000
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 14564477d55dafebf2036c822930e1a02a47472a
Author: Noel Power <noel.power at suse.com>
Date: Wed Feb 17 09:34:40 2021 +0000
s3/modules: ensure catia_set_dos_attributes passes on pathref
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 0f0b945c1aa9a32fe103395216d5212d53134c5a
Author: Noel Power <noel.power at suse.com>
Date: Tue Feb 16 20:25:31 2021 +0000
s3/smbd: posix_acls SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a241e9b3d437738357d071ccb4d9cf884ed219f0
Author: Noel Power <noel.power at suse.com>
Date: Tue Feb 16 19:55:23 2021 +0000
s3/modules: posixacl convert from SMB_VFS_SETXATTR -> SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 6b725386992a24ae70dfb26a32cbec469c759e50
Author: Noel Power <noel.power at suse.com>
Date: Tue Feb 16 19:25:59 2021 +0000
s3/lib: adouble SMB_VFS_SETXATTR => SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ecd83a5877e869df4007c28a0164d0f332d63539
Author: Noel Power <noel.power at suse.com>
Date: Tue Feb 16 18:49:19 2021 +0000
s3/smbd: set_ea SMB_VFS_FSETXATTR => SMB_VFS_FSETXATTR
Signed-off-by: Noel Power <noel.power at suse.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
examples/VFS/skel_opaque.c | 12 ------
examples/VFS/skel_transparent.c | 12 ------
source3/include/vfs.h | 13 +-----
source3/include/vfs_macros.h | 5 ---
source3/lib/adouble.c | 14 +++----
source3/modules/The_New_VFS.org | 2 +-
source3/modules/The_New_VFS.txt | 2 +-
source3/modules/posixacl_xattr.c | 2 +-
source3/modules/vfs_acl_xattr.c | 8 +---
source3/modules/vfs_cap.c | 44 -------------------
source3/modules/vfs_catia.c | 77 +++++-----------------------------
source3/modules/vfs_ceph.c | 17 --------
source3/modules/vfs_ceph_snapshots.c | 10 +++--
source3/modules/vfs_default.c | 11 -----
source3/modules/vfs_fake_acls.c | 26 ++++++++----
source3/modules/vfs_full_audit.c | 23 ----------
source3/modules/vfs_glusterfs.c | 9 ----
source3/modules/vfs_media_harmony.c | 32 --------------
source3/modules/vfs_nfs4acl_xattr.c | 10 +----
source3/modules/vfs_not_implemented.c | 12 ------
source3/modules/vfs_posix_eadb.c | 16 -------
source3/modules/vfs_shadow_copy2.c | 10 +++--
source3/modules/vfs_snapper.c | 11 +++--
source3/modules/vfs_streams_depot.c | 25 +++++++++--
source3/modules/vfs_streams_xattr.c | 36 +++++++++++-----
source3/modules/vfs_time_audit.c | 26 ------------
source3/modules/vfs_unityed_media.c | 34 ---------------
source3/modules/vfs_vxfs.c | 79 -----------------------------------
source3/modules/vfs_xattr_tdb.c | 30 -------------
source3/smbd/dosmode.c | 21 +++++++---
source3/smbd/nttrans.c | 22 +++++++++-
source3/smbd/posix_acls.c | 8 +---
source3/smbd/reply.c | 43 ++++++++++++-------
source3/smbd/trans2.c | 37 +++++++---------
source3/smbd/vfs.c | 12 ------
source3/torture/cmd_vfs.c | 25 ++++++++---
36 files changed, 206 insertions(+), 570 deletions(-)
Changeset truncated at 500 lines:
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 3fcbd321564..92ae46f7f5a 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -948,17 +948,6 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
return -1;
}
-static int skel_setxattr(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- errno = ENOSYS;
- return -1;
-}
-
static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
const char *name, const void *value, size_t size,
int flags)
@@ -1133,7 +1122,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
.flistxattr_fn = skel_flistxattr,
.removexattr_fn = skel_removexattr,
.fremovexattr_fn = skel_fremovexattr,
- .setxattr_fn = skel_setxattr,
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 87eec7544d1..93e5626f8ac 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -1239,17 +1239,6 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
}
-static int skel_setxattr(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
- name, value, size, flags);
-}
-
static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
const char *name, const void *value, size_t size,
int flags)
@@ -1439,7 +1428,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
.flistxattr_fn = skel_flistxattr,
.removexattr_fn = skel_removexattr,
.fremovexattr_fn = skel_fremovexattr,
- .setxattr_fn = skel_setxattr,
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index db2283b7cd0..96477f27e89 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -344,6 +344,7 @@
* Version 44 - Remove SMB_VFS_SYS_ACL_SET_FILE()
* Change to Version 45 - will ship with 4.15
* Version 45 - Remove SMB_VFS_LISTXATTR
+ * Version 45 - Remove SMB_VFS_SETXATTR
*/
#define SMB_VFS_INTERFACE_VERSION 45
@@ -1251,12 +1252,6 @@ struct vfs_fn_pointers {
const struct smb_filename *smb_fname,
const char *name);
int (*fremovexattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name);
- int (*setxattr_fn)(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags);
int (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags);
/* aio operations */
@@ -1775,12 +1770,6 @@ int smb_vfs_call_removexattr(struct vfs_handle_struct *handle,
const char *name);
int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name);
-int smb_vfs_call_setxattr(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags);
int smb_vfs_call_lsetxattr(struct vfs_handle_struct *handle, const char *path,
const char *name, const void *value, size_t size,
int flags);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index d006aaf60bd..dab0c306a68 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -561,11 +561,6 @@
#define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
smb_vfs_call_fremovexattr((handle)->next,(fsp),(name))
-#define SMB_VFS_SETXATTR(conn,smb_fname,name,value,size,flags) \
- smb_vfs_call_setxattr((conn)->vfs_handles,(smb_fname),(name),(value),(size),(flags))
-#define SMB_VFS_NEXT_SETXATTR(handle,smb_fname,name,value,size,flags) \
- smb_vfs_call_setxattr((handle)->next,(smb_fname),(name),(value),(size),(flags))
-
#define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \
smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags))
#define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) \
diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index 6fd290a31b8..39895aff3f8 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -2598,8 +2598,7 @@ int ad_set(vfs_handle_struct *handle,
return -1;
}
- ret = SMB_VFS_SETXATTR(handle->conn,
- smb_fname,
+ ret = SMB_VFS_FSETXATTR(smb_fname->fsp,
AFPINFO_EA_NETATALK,
ad->ad_data,
AD_DATASZ_XATTR, 0);
@@ -2641,13 +2640,12 @@ int ad_fset(struct vfs_handle_struct *handle,
switch (ad->ad_type) {
case ADOUBLE_META:
- rc = SMB_VFS_NEXT_SETXATTR(handle,
- fsp->fsp_name,
- AFPINFO_EA_NETATALK,
- ad->ad_data,
- AD_DATASZ_XATTR, 0);
+ rc = SMB_VFS_NEXT_FSETXATTR(handle,
+ fsp->base_fsp ? fsp->base_fsp : fsp,
+ AFPINFO_EA_NETATALK,
+ ad->ad_data,
+ AD_DATASZ_XATTR, 0);
break;
-
case ADOUBLE_RSRC:
len = SMB_VFS_NEXT_PWRITE(handle,
fsp,
diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org
index 4533509d9cd..82ba2ea2519 100644
--- a/source3/modules/The_New_VFS.org
+++ b/source3/modules/The_New_VFS.org
@@ -284,7 +284,7 @@ whenever VFS access is done in a piecemeal fashion.
| SMB_VFS_SET_COMPRESSION() | [[fsp][fsp]] | - |
| SMB_VFS_SET_DOS_ATTRIBUTES() | [[Path][Path]] | - |
| SMB_VFS_SET_QUOTA() | [[Special][Special]] | - |
-| SMB_VFS_SETXATTR() | [[Path][Path]] | Todo |
+| SMB_VFS_SETXATTR() | [[Path][Path]] | - |
| SMB_VFS_SNAP_CHECK_PATH() | [[Disk][Disk]] | - |
| SMB_VFS_SNAP_CREATE() | [[Disk][Disk]] | - |
| SMB_VFS_SNAP_DELETE() | [[Disk][Disk]] | - |
diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt
index 0a9f60b84f8..711bfee4413 100644
--- a/source3/modules/The_New_VFS.txt
+++ b/source3/modules/The_New_VFS.txt
@@ -352,7 +352,7 @@ Table of Contents
SMB_VFS_SET_COMPRESSION() [fsp] -
SMB_VFS_SET_DOS_ATTRIBUTES() [Path] -
SMB_VFS_SET_QUOTA() [Special] -
- SMB_VFS_SETXATTR() [Path] Todo
+ SMB_VFS_SETXATTR() [Path] -
SMB_VFS_SNAP_CHECK_PATH() [Disk] -
SMB_VFS_SNAP_CREATE() [Disk] -
SMB_VFS_SNAP_DELETE() [Disk] -
diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c
index 7582ceb121e..a835f2e5ebe 100644
--- a/source3/modules/posixacl_xattr.c
+++ b/source3/modules/posixacl_xattr.c
@@ -474,7 +474,7 @@ int posixacl_xattr_acl_set_file(vfs_handle_struct *handle,
return -1;
}
- return SMB_VFS_SETXATTR(handle->conn, smb_fname,
+ return SMB_VFS_FSETXATTR(smb_fname->fsp,
name, buf, size, 0);
}
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index f5a26ec5592..9e20896cb2f 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -196,14 +196,8 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
(unsigned int)pblob->length, fsp_str_dbg(fsp)));
become_root();
- if (fsp_get_pathref_fd(fsp) != -1) {
- ret = SMB_VFS_FSETXATTR(fsp, XATTR_NTACL_NAME,
+ ret = SMB_VFS_FSETXATTR(fsp, XATTR_NTACL_NAME,
pblob->data, pblob->length, 0);
- } else {
- ret = SMB_VFS_SETXATTR(fsp->conn, fsp->fsp_name,
- XATTR_NTACL_NAME,
- pblob->data, pblob->length, 0);
- }
if (ret) {
saved_errno = errno;
}
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 5c2474e66e7..4c65361e4e2 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -960,49 +960,6 @@ static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,
return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, cappath);
}
-static int cap_setxattr(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- struct smb_filename *cap_smb_fname = NULL;
- char *cappath = capencode(talloc_tos(), smb_fname->base_name);
- char *capname = capencode(talloc_tos(), name);
- int ret;
- int saved_errno = 0;
-
- if (!cappath || !capname) {
- errno = ENOMEM;
- return -1;
- }
- cap_smb_fname = synthetic_smb_fname(talloc_tos(),
- cappath,
- NULL,
- NULL,
- smb_fname->twrp,
- smb_fname->flags);
- if (cap_smb_fname == NULL) {
- TALLOC_FREE(cappath);
- TALLOC_FREE(capname);
- errno = ENOMEM;
- return -1;
- }
- ret = SMB_VFS_NEXT_SETXATTR(handle, cap_smb_fname,
- capname, value, size, flags);
- if (ret == -1) {
- saved_errno = errno;
- }
- TALLOC_FREE(cappath);
- TALLOC_FREE(capname);
- TALLOC_FREE(cap_smb_fname);
- if (saved_errno) {
- errno = saved_errno;
- }
- return ret;
-}
-
static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path, const void *value, size_t size, int flags)
{
char *cappath = capencode(talloc_tos(), path);
@@ -1116,7 +1073,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
.fgetxattr_fn = cap_fgetxattr,
.removexattr_fn = cap_removexattr,
.fremovexattr_fn = cap_fremovexattr,
- .setxattr_fn = cap_setxattr,
.fsetxattr_fn = cap_fsetxattr,
.create_dfs_pathat_fn = cap_create_dfs_pathat,
.read_dfs_pathat_fn = cap_read_dfs_pathat
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 0a3fa5ca791..8e648816c68 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -1298,66 +1298,6 @@ catia_removexattr(vfs_handle_struct *handle,
return ret;
}
-static int
-catia_setxattr(vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- struct smb_filename *mapped_smb_fname = NULL;
- char *mapped_name = NULL;
- char *mapped_ea_name = NULL;
- NTSTATUS status;
- ssize_t ret;
- int saved_errno = 0;
-
- status = catia_string_replace_allocate(handle->conn,
- smb_fname->base_name,
- &mapped_name,
- vfs_translate_to_unix);
- if (!NT_STATUS_IS_OK(status)) {
- errno = map_errno_from_nt_status(status);
- return -1;
- }
-
- status = catia_string_replace_allocate(handle->conn,
- name, &mapped_ea_name, vfs_translate_to_unix);
- if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(mapped_name);
- errno = map_errno_from_nt_status(status);
- return -1;
- }
-
- mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
- mapped_name,
- NULL,
- &smb_fname->st,
- smb_fname->twrp,
- smb_fname->flags);
- if (mapped_smb_fname == NULL) {
- TALLOC_FREE(mapped_name);
- TALLOC_FREE(mapped_ea_name);
- errno = ENOMEM;
- return -1;
- }
-
- ret = SMB_VFS_NEXT_SETXATTR(handle, mapped_smb_fname, mapped_ea_name,
- value, size, flags);
- if (ret == -1) {
- saved_errno = errno;
- }
- TALLOC_FREE(mapped_name);
- TALLOC_FREE(mapped_ea_name);
- TALLOC_FREE(mapped_smb_fname);
- if (saved_errno != 0) {
- errno = saved_errno;
- }
-
- return ret;
-}
-
static int catia_fstat(vfs_handle_struct *handle,
files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
@@ -2207,15 +2147,21 @@ static NTSTATUS catia_set_dos_attributes(struct vfs_handle_struct *handle,
errno = map_errno_from_nt_status(status);
return status;
}
- mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+ status = synthetic_pathref(talloc_tos(),
+ handle->conn->cwd_fsp,
mapped_name,
NULL,
&smb_fname->st,
smb_fname->twrp,
- smb_fname->flags);
- if (mapped_smb_fname == NULL) {
- TALLOC_FREE(mapped_name);
- return NT_STATUS_NO_MEMORY;
+ smb_fname->flags,
+ &mapped_smb_fname);
+ /*
+ * how about NT_STATUS_OBJECT_NAME_NOT_FOUND / link ? not sure
+ * if we let that go and return success or not :/
+ */
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
status = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle,
@@ -2382,7 +2328,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = catia_removexattr,
- .setxattr_fn = catia_setxattr,
.fgetxattr_fn = catia_fgetxattr,
.flistxattr_fn = catia_flistxattr,
.fremovexattr_fn = catia_fremovexattr,
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index d37e749455a..6eb432e2c98 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1312,22 +1312,6 @@ static int cephwrap_fremovexattr(struct vfs_handle_struct *handle, struct files_
WRAP_RETURN(ret);
}
-static int cephwrap_setxattr(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- int ret;
- DBG_DEBUG("[CEPH] setxattr(%p, %s, %s, %p, %llu, %d)\n", handle,
- smb_fname->base_name, name, value, llu(size), flags);
- ret = ceph_setxattr(handle->data, smb_fname->base_name,
- name, value, size, flags);
- DBG_DEBUG("[CEPH] setxattr(...) = %d\n", ret);
- WRAP_RETURN(ret);
-}
-
static int cephwrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
{
int ret;
@@ -1582,7 +1566,6 @@ static struct vfs_fn_pointers ceph_fns = {
.flistxattr_fn = cephwrap_flistxattr,
.removexattr_fn = cephwrap_removexattr,
.fremovexattr_fn = cephwrap_fremovexattr,
- .setxattr_fn = cephwrap_setxattr,
.fsetxattr_fn = cephwrap_fsetxattr,
/* Posix ACL Operations */
diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c
index 9d93b8ba9da..3211c1c7dce 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -1319,14 +1319,16 @@ static int ceph_snap_gmt_removexattr(vfs_handle_struct *handle,
return SMB_VFS_NEXT_REMOVEXATTR(handle, csmb_fname, aname);
}
-static int ceph_snap_gmt_setxattr(struct vfs_handle_struct *handle,
- const struct smb_filename *csmb_fname,
+static int ceph_snap_gmt_fsetxattr(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
const char *aname, const void *value,
size_t size, int flags)
{
+ const struct smb_filename *csmb_fname = NULL;
time_t timestamp = 0;
int ret;
+ csmb_fname = fsp->fsp_name;
ret = ceph_snap_gmt_strip_snapshot(handle,
csmb_fname,
×tamp, NULL, 0);
@@ -1338,7 +1340,7 @@ static int ceph_snap_gmt_setxattr(struct vfs_handle_struct *handle,
errno = EROFS;
return -1;
}
- return SMB_VFS_NEXT_SETXATTR(handle, csmb_fname,
+ return SMB_VFS_NEXT_FSETXATTR(handle, fsp,
aname, value, size, flags);
}
@@ -1491,7 +1493,7 @@ static struct vfs_fn_pointers ceph_snap_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = ceph_snap_gmt_removexattr,
- .setxattr_fn = ceph_snap_gmt_setxattr,
+ .fsetxattr_fn = ceph_snap_gmt_fsetxattr,
.chflags_fn = ceph_snap_gmt_chflags,
.get_real_filename_fn = ceph_snap_gmt_get_real_filename,
};
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 7291813f609..e48deb022a7 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -3671,16 +3671,6 @@ static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_s
return removexattr(fsp->fsp_name->base_name, name);
}
-static int vfswrap_setxattr(struct vfs_handle_struct *handle,
- const struct smb_filename *smb_fname,
- const char *name,
- const void *value,
- size_t size,
- int flags)
-{
- return setxattr(smb_fname->base_name, name, value, size, flags);
-}
-
static int vfswrap_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
{
int fd = fsp_get_pathref_fd(fsp);
@@ -3891,7 +3881,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
.flistxattr_fn = vfswrap_flistxattr,
.removexattr_fn = vfswrap_removexattr,
.fremovexattr_fn = vfswrap_fremovexattr,
- .setxattr_fn = vfswrap_setxattr,
.fsetxattr_fn = vfswrap_fsetxattr,
/* aio operations */
diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c
index 44ba990d5b6..716df540e47 100644
--- a/source3/modules/vfs_fake_acls.c
+++ b/source3/modules/vfs_fake_acls.c
@@ -345,7 +345,7 @@ static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle,
name = FAKE_ACL_DEFAULT_XATTR;
break;
}
- ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
+ ret = SMB_VFS_NEXT_FSETXATTR(handle, smb_fname->fsp,
name, blob.data, blob.length, 0);
TALLOC_FREE(frame);
return ret;
@@ -444,8 +444,8 @@ static int fake_acls_lchown(vfs_handle_struct *handle,
* to.
*/
SIVAL(id_buf, 0, uid);
- ret = SMB_VFS_NEXT_SETXATTR(handle,
- smb_fname,
+ ret = SMB_VFS_NEXT_FSETXATTR(handle,
+ smb_fname->fsp,
--
Samba Shared Repository
More information about the samba-cvs
mailing list