1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

VFS: Remove SMB_VFS_SETXATTR, no longer used

---------------
                                  /               \
                                 /      REST       \
                                /        IN         \
                               /        PEACE        \
                              /                       \
                              |                       |
                              |   SMB_VFS_SETXATTR    |
                              |                       |
                              |                       |
                              |       19 February     |
                              |          2021         |
                              |                       |
                              |                       |
                             *|     *  *  *           | *
                    _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Signed-off-by: Noel Power <noel.power@suse.com>
This commit is contained in:
Noel Power 2021-02-19 10:39:49 +00:00 committed by Jeremy Allison
parent 48d18f451e
commit 82e1402636
21 changed files with 1 additions and 517 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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);

View File

@ -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) \

View File

@ -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

View File

@ -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)
@ -2388,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,

View File

@ -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 */

View File

@ -1319,29 +1319,6 @@ 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,
const char *aname, const void *value,
size_t size, int flags)
{
time_t timestamp = 0;
int ret;
ret = ceph_snap_gmt_strip_snapshot(handle,
csmb_fname,
&timestamp, NULL, 0);
if (ret < 0) {
errno = -ret;
return -1;
}
if (timestamp != 0) {
errno = EROFS;
return -1;
}
return SMB_VFS_NEXT_SETXATTR(handle, csmb_fname,
aname, value, size, flags);
}
static int ceph_snap_gmt_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *aname, const void *value,
@ -1516,7 +1493,6 @@ 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,

View File

@ -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 */

View File

@ -212,7 +212,6 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_FLISTXATTR,
SMB_VFS_OP_REMOVEXATTR,
SMB_VFS_OP_FREMOVEXATTR,
SMB_VFS_OP_SETXATTR,
SMB_VFS_OP_FSETXATTR,
/* aio operations */
@ -343,7 +342,6 @@ static struct {
{ SMB_VFS_OP_FLISTXATTR, "flistxattr" },
{ SMB_VFS_OP_REMOVEXATTR, "removexattr" },
{ SMB_VFS_OP_FREMOVEXATTR, "fremovexattr" },
{ SMB_VFS_OP_SETXATTR, "setxattr" },
{ SMB_VFS_OP_FSETXATTR, "fsetxattr" },
{ SMB_VFS_OP_AIO_FORCE, "aio_force" },
{ SMB_VFS_OP_IS_OFFLINE, "is_offline" },
@ -2863,26 +2861,6 @@ static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name, const void *value, size_t size,
int flags)
{
int result;
result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
flags);
do_log(SMB_VFS_OP_SETXATTR,
(result >= 0),
handle,
"%s|%s",
smb_fname_str_do_log(handle->conn, smb_fname),
name);
return result;
}
static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags)
@ -3078,7 +3056,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.flistxattr_fn = smb_full_audit_flistxattr,
.removexattr_fn = smb_full_audit_removexattr,
.fremovexattr_fn = smb_full_audit_fremovexattr,
.setxattr_fn = smb_full_audit_setxattr,
.fsetxattr_fn = smb_full_audit_fsetxattr,
.aio_force_fn = smb_full_audit_aio_force,
.durable_cookie_fn = smb_full_audit_durable_cookie,

View File

@ -2072,14 +2072,6 @@ static int vfs_gluster_fremovexattr(struct vfs_handle_struct *handle,
return glfs_fremovexattr(glfd, name);
}
static int vfs_gluster_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value, size_t size, int flags)
{
return glfs_setxattr(handle->data, smb_fname->base_name, name, value, size, flags);
}
static int vfs_gluster_fsetxattr(struct vfs_handle_struct *handle,
files_struct *fsp, const char *name,
const void *value, size_t size, int flags)
@ -2352,7 +2344,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
.flistxattr_fn = vfs_gluster_flistxattr,
.removexattr_fn = vfs_gluster_removexattr,
.fremovexattr_fn = vfs_gluster_fremovexattr,
.setxattr_fn = vfs_gluster_setxattr,
.fsetxattr_fn = vfs_gluster_fsetxattr,
/* AIO Operations */

View File

@ -2166,37 +2166,6 @@ out:
* Failure: set errno, return -1
* In this case, "name" is an attr name.
*/
static int mh_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value,
size_t size,
int flags)
{
int status;
struct smb_filename *clientFname = NULL;
DEBUG(MH_INFO_DEBUG, ("Entering mh_setxattr\n"));
if (!is_in_media_files(smb_fname->base_name)) {
status = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value,
size, flags);
goto out;
}
status = alloc_get_client_smb_fname(handle,
talloc_tos(),
smb_fname,
&clientFname);
if (status != 0) {
goto err;
}
status = SMB_VFS_NEXT_SETXATTR(handle, clientFname, name, value,
size, flags);
err:
TALLOC_FREE(clientFname);
out:
return status;
}
/* VFS operations structure */
@ -2250,7 +2219,6 @@ static struct vfs_fn_pointers vfs_mh_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = mh_removexattr,
.setxattr_fn = mh_setxattr,
/* aio operations */
};

View File

@ -952,17 +952,6 @@ int vfs_not_implemented_fremovexattr(vfs_handle_struct *handle,
return -1;
}
int vfs_not_implemented_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;
}
int vfs_not_implemented_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,
const char *name, const void *value, size_t size,
int flags)
@ -1137,7 +1126,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
.flistxattr_fn = vfs_not_implemented_flistxattr,
.removexattr_fn = vfs_not_implemented_removexattr,
.fremovexattr_fn = vfs_not_implemented_fremovexattr,
.setxattr_fn = vfs_not_implemented_setxattr,
.fsetxattr_fn = vfs_not_implemented_fsetxattr,
/* aio operations */

View File

@ -126,21 +126,6 @@ static int posix_eadb_setattr(struct tdb_wrap *db_ctx,
return 0;
}
static int posix_eadb_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value,
size_t size,
int flags)
{
struct tdb_wrap *db;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct tdb_wrap, return -1);
return posix_eadb_setattr(db, smb_fname->base_name,
-1, name, value, size, flags);
}
static int posix_eadb_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *name, const void *value,
@ -476,7 +461,6 @@ static struct vfs_fn_pointers vfs_posix_eadb_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.fgetxattr_fn = posix_eadb_fgetxattr,
.setxattr_fn = posix_eadb_setxattr,
.fsetxattr_fn = posix_eadb_fsetxattr,
.flistxattr_fn = posix_eadb_flistxattr,
.removexattr_fn = posix_eadb_removexattr,

View File

@ -2333,28 +2333,6 @@ static int shadow_copy2_removexattr(vfs_handle_struct *handle,
return SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, aname);
}
static int shadow_copy2_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *aname, const void *value,
size_t size, int flags)
{
time_t timestamp = 0;
if (!shadow_copy2_strip_snapshot(talloc_tos(),
handle,
smb_fname,
&timestamp,
NULL)) {
return -1;
}
if (timestamp != 0) {
errno = EROFS;
return -1;
}
return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
aname, value, size, flags);
}
static int shadow_copy2_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *aname, const void *value,
@ -3225,7 +3203,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = shadow_copy2_removexattr,
.setxattr_fn = shadow_copy2_setxattr,
.fsetxattr_fn = shadow_copy2_fsetxattr,
.chflags_fn = shadow_copy2_chflags,
.get_real_filename_fn = shadow_copy2_get_real_filename,

View File

@ -2531,28 +2531,6 @@ static int snapper_gmt_removexattr(vfs_handle_struct *handle,
return SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, aname);
}
static int snapper_gmt_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *aname, const void *value,
size_t size, int flags)
{
time_t timestamp = 0;
if (!snapper_gmt_strip_snapshot(talloc_tos(),
handle,
smb_fname,
&timestamp,
NULL)) {
return -1;
}
if (timestamp != 0) {
errno = EROFS;
return -1;
}
return SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
aname, value, size, flags);
}
static int snapper_gmt_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *aname, const void *value,
@ -2779,7 +2757,6 @@ static struct vfs_fn_pointers snapper_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = snapper_gmt_removexattr,
.setxattr_fn = snapper_gmt_setxattr,
.fsetxattr_fn = snapper_gmt_fsetxattr,
.chflags_fn = snapper_gmt_chflags,
.get_real_filename_fn = snapper_gmt_get_real_filename,

View File

@ -2694,31 +2694,6 @@ static int smb_time_audit_fremovexattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_time_audit_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value,
size_t size,
int flags)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size,
flags);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
smb_time_audit_log_fname("setxattr", timediff,
smb_fname->base_name);
}
return result;
}
static int smb_time_audit_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags)
@ -2929,7 +2904,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.flistxattr_fn = smb_time_audit_flistxattr,
.removexattr_fn = smb_time_audit_removexattr,
.fremovexattr_fn = smb_time_audit_fremovexattr,
.setxattr_fn = smb_time_audit_setxattr,
.fsetxattr_fn = smb_time_audit_fsetxattr,
.aio_force_fn = smb_time_audit_aio_force,
.durable_cookie_fn = smb_time_audit_durable_cookie,

View File

@ -1759,39 +1759,6 @@ err:
return status;
}
static int um_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value,
size_t size,
int flags)
{
int status;
struct smb_filename *client_fname = NULL;
DEBUG(10, ("Entering um_setxattr\n"));
if (!is_in_media_files(smb_fname->base_name)) {
return SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value,
size, flags);
}
status = alloc_get_client_smb_fname(handle,
talloc_tos(),
smb_fname,
&client_fname);
if (status != 0) {
goto err;
}
status = SMB_VFS_NEXT_SETXATTR(handle, client_fname, name, value,
size, flags);
err:
TALLOC_FREE(client_fname);
return status;
}
static int um_connect(vfs_handle_struct *handle,
const char *service,
const char *user)
@ -1882,7 +1849,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
.getxattrat_send_fn = vfs_not_implemented_getxattrat_send,
.getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv,
.removexattr_fn = um_removexattr,
.setxattr_fn = um_setxattr,
};
static_decl_vfs;

View File

@ -499,84 +499,6 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle,
return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, type, theacl);
}
static int vxfs_set_xattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname_in,
const char *name,
const void *value,
size_t size,
int flags)
{
struct smb_filename *smb_fname = NULL;
bool is_dir = false;
int ret = 0;
int saved_errno = 0;
DEBUG(10, ("In vxfs_set_xattr\n"));
smb_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname_in);
if (smb_fname == NULL) {
errno = ENOMEM;
return -1;
}
if (SMB_VFS_NEXT_STAT(handle, smb_fname) != 0) {
TALLOC_FREE(smb_fname);
return -1;
}
is_dir = S_ISDIR(smb_fname->st.st_ex_mode);
ret = vxfs_setxattr_path(smb_fname_in->base_name, name, value, size,
flags, is_dir);
if ((ret == 0) ||
((ret == -1) && (errno != ENOTSUP) && (errno != ENOSYS))) {
/*
* Now remve old style xattr if it exists
*/
SMB_VFS_NEXT_REMOVEXATTR(handle, smb_fname, name);
/*
* Do not bother about return value
*/
if (ret != 0) {
saved_errno = errno;
}
goto fail;
}
DEBUG(10, ("Fallback to xattr\n"));
if (strcmp(name, XATTR_NTACL_NAME) == 0) {
ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
XATTR_USER_NTACL,
value, size, flags);
if (ret != 0) {
saved_errno = errno;
goto fail;
}
return 0;
}
/* Clients can't set XATTR_USER_NTACL directly. */
if (strcasecmp(name, XATTR_USER_NTACL) == 0) {
saved_errno = EACCES;
ret = -1;
goto fail;
}
ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname,
name, value, size, flags);
if (ret != 0) {
saved_errno = errno;
goto fail;
}
fail:
TALLOC_FREE(smb_fname);
if (saved_errno != 0) {
saved_errno = errno;
}
return ret;
}
static int vxfs_fset_xattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags){
@ -911,7 +833,6 @@ static struct vfs_fn_pointers vfs_vxfs_fns = {
.flistxattr_fn = vxfs_flistxattr,
.removexattr_fn = vxfs_remove_xattr,
.fremovexattr_fn = vxfs_fremove_xattr,
.setxattr_fn = vxfs_set_xattr,
.fsetxattr_fn = vxfs_fset_xattr,
};

View File

@ -283,35 +283,6 @@ static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
return xattr_size;
}
static int xattr_tdb_setxattr(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
const char *name,
const void *value,
size_t size,
int flags)
{
struct file_id id;
struct db_context *db;
int ret;
TALLOC_CTX *frame = talloc_stackframe();
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
if (!xattr_tdb_init(-1, frame, &db))
{
TALLOC_FREE(frame); return -1;
});
ret = xattr_tdb_get_file_id(handle, smb_fname->base_name, &id);
if (ret == -1) {
TALLOC_FREE(frame);
return -1;
}
ret = xattr_tdb_setattr(db, &id, name, value, size, flags);
TALLOC_FREE(frame);
return ret;
}
static int xattr_tdb_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *name, const void *value,
@ -710,7 +681,6 @@ static struct vfs_fn_pointers vfs_xattr_tdb_fns = {
.getxattrat_send_fn = xattr_tdb_getxattrat_send,
.getxattrat_recv_fn = xattr_tdb_getxattrat_recv,
.fgetxattr_fn = xattr_tdb_fgetxattr,
.setxattr_fn = xattr_tdb_setxattr,
.fsetxattr_fn = xattr_tdb_fsetxattr,
.flistxattr_fn = xattr_tdb_flistxattr,
.removexattr_fn = xattr_tdb_removexattr,

View File

@ -2940,18 +2940,6 @@ int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle,
return handle->fns->fremovexattr_fn(handle, fsp, 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)
{
VFS_FIND(setxattr);
return handle->fns->setxattr_fn(handle, smb_fname,
name, value, size, flags);
}
int smb_vfs_call_fsetxattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name,
const void *value, size_t size, int flags)