1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure

If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2012-04-04 08:34:25 +10:00
parent c5b17c5555
commit c70ac29c54
17 changed files with 6 additions and 227 deletions

View File

@ -80,7 +80,6 @@
<member>lock</member>
<member>lremovexattr</member>
<member>lseek</member>
<member>lsetxattr</member>
<member>lstat</member>
<member>mkdir</member>
<member>mknod</member>

View File

@ -711,12 +711,6 @@ static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char
return -1;
}
static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, 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)
{
errno = ENOSYS;
@ -907,7 +901,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
.lremovexattr_fn = skel_lremovexattr,
.fremovexattr_fn = skel_fremovexattr,
.setxattr_fn = skel_setxattr,
.lsetxattr_fn = skel_lsetxattr,
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */

View File

@ -681,11 +681,6 @@ static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char
return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags);
}
static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
{
return SMB_VFS_NEXT_LSETXATTR(handle, path, 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)
{
return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
@ -865,7 +860,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
.lremovexattr_fn = skel_lremovexattr,
.fremovexattr_fn = skel_fremovexattr,
.setxattr_fn = skel_setxattr,
.lsetxattr_fn = skel_lsetxattr,
.fsetxattr_fn = skel_fsetxattr,
/* aio operations */

View File

@ -1301,16 +1301,16 @@ case "$host_os" in
*)
AC_SEARCH_LIBS(getxattr, [attr])
AC_CHECK_FUNCS(getxattr,[
AC_CHECK_FUNCS(fgetxattr listxattr flistxattr removexattr lremovexattr fremovexattr setxattr lsetxattr fsetxattr)
AC_CHECK_FUNCS(fgetxattr listxattr flistxattr removexattr lremovexattr fremovexattr setxattr fsetxattr)
])
AC_CHECK_FUNCS(getea,[
AC_CHECK_FUNCS(fgetea lgetea listea flistea removeea fremoveea lremoveea setea fsetea lsetea)
AC_CHECK_FUNCS(fgetea lgetea listea flistea removeea fremoveea lremoveea setea fsetea)
])
AC_CHECK_FUNCS(attr_get,[
AC_CHECK_FUNCS(attr_list attr_set attr_remove attr_getf attr_listf attr_setf attr_removef)
])
AC_CHECK_FUNCS(extattr_delete_file,[
AC_CHECK_FUNCS(extattr_delete_fd extattr_delete_link extattr_get_fd extattr_get_file extattr_get_link extattr_list_fd extattr_list_file extattr_list_link extattr_set_fd extattr_set_file extattr_set_link)
AC_CHECK_FUNCS(extattr_delete_fd extattr_delete_link extattr_get_fd extattr_get_file extattr_get_link extattr_list_fd extattr_list_file extattr_list_link extattr_set_fd extattr_set_file)
])
;;
esac

View File

@ -358,7 +358,6 @@ int sys_removexattr (const char *path, const char *name);
int sys_lremovexattr (const char *path, const char *name);
int sys_fremovexattr (int filedes, const char *name);
int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags);
int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags);
int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
uint32 unix_dev_major(SMB_DEV_T dev);
uint32 unix_dev_minor(SMB_DEV_T dev);

View File

@ -138,7 +138,7 @@
/* Bump to version 29 - Samba 3.6.0 will ship with interface version 28. */
/* Leave at 29 - not yet releases. Add fsctl. Richard Sharpe */
/* Leave at 29 - not yet released. add SMB_VFS_GET_DFS_REFERRAL() - metze */
/* Leave at 29 - not yet released. Remove llistxattr and lgetxattr - abartlet */
/* Leave at 29 - not yet released. Remove l{list,get,set,remove}xattr - abartlet */
#define SMB_VFS_INTERFACE_VERSION 29
/*
@ -406,7 +406,6 @@ struct vfs_fn_pointers {
int (*lremovexattr_fn)(struct vfs_handle_struct *handle, const char *path, 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 char *path, const char *name, const void *value, size_t size, int flags);
int (*lsetxattr_fn)(struct vfs_handle_struct *handle, const char *path, 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 */

View File

@ -554,11 +554,6 @@
#define SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags) \
smb_vfs_call_setxattr((handle)->next,(path),(name),(value),(size),(flags))
#define SMB_VFS_LSETXATTR(conn,path,name,value,size,flags) \
smb_vfs_call_lsetxattr((conn)->vfs_handles,(path),(name),(value),(size),(flags))
#define SMB_VFS_NEXT_LSETXATTR(handle,path,name,value,size,flags) \
smb_vfs_call_lsetxattr((handle)->next,(path),(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

@ -1821,70 +1821,6 @@ int sys_setxattr (const char *path, const char *name, const void *value, size_t
#endif
}
int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags)
{
#if defined(HAVE_LSETXATTR)
return lsetxattr(path, name, value, size, flags);
#elif defined(HAVE_SETXATTR) && defined(XATTR_ADD_OPT)
int options = XATTR_NOFOLLOW;
return setxattr(path, name, value, size, 0, options);
#elif defined(LSETEA)
return lsetea(path, name, value, size, flags);
#elif defined(HAVE_EXTATTR_SET_LINK)
char *s;
int retval = 0;
int attrnamespace = (strncmp(name, "system", 6) == 0) ?
EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER;
const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1;
if (flags) {
/* Check attribute existence */
retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0);
if (retval < 0) {
/* REPLACE attribute, that doesn't exist */
if (flags & XATTR_REPLACE && errno == ENOATTR) {
errno = ENOATTR;
return -1;
}
/* Ignore other errors */
}
else {
/* CREATE attribute, that already exists */
if (flags & XATTR_CREATE) {
errno = EEXIST;
return -1;
}
}
}
retval = extattr_set_link(path, attrnamespace, attrname, value, size);
return (retval < 0) ? -1 : 0;
#elif defined(HAVE_ATTR_SET)
int myflags = ATTR_DONTFOLLOW;
char *attrname = strchr(name,'.') + 1;
if (strncmp(name, "system", 6) == 0) myflags |= ATTR_ROOT;
if (flags & XATTR_CREATE) myflags |= ATTR_CREATE;
if (flags & XATTR_REPLACE) myflags |= ATTR_REPLACE;
return attr_set(path, attrname, (const char *)value, size, myflags);
#elif defined(HAVE_ATTROPEN)
int ret = -1;
int myflags = O_RDWR | AT_SYMLINK_NOFOLLOW;
int attrfd;
if (flags & XATTR_CREATE) myflags |= O_EXCL;
if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT;
attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE);
if (attrfd >= 0) {
ret = solaris_write_xattr(attrfd, value, size);
close(attrfd);
}
return ret;
#else
errno = ENOSYS;
return -1;
#endif
}
int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags)
{
#if defined(HAVE_FSETXATTR)

View File

@ -523,18 +523,6 @@ static int cap_setxattr(vfs_handle_struct *handle, const char *path, const char
return SMB_VFS_NEXT_SETXATTR(handle, cappath, capname, value, size, flags);
}
static int cap_lsetxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
{
char *cappath = capencode(talloc_tos(), path);
char *capname = capencode(talloc_tos(), name);
if (!cappath || !capname) {
errno = ENOMEM;
return -1;
}
return SMB_VFS_NEXT_LSETXATTR(handle, cappath, capname, value, size, flags);
}
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);
@ -578,7 +566,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
.lremovexattr_fn = cap_lremovexattr,
.fremovexattr_fn = cap_fremovexattr,
.setxattr_fn = cap_setxattr,
.lsetxattr_fn = cap_lsetxattr,
.fsetxattr_fn = cap_fsetxattr
};

View File

@ -919,29 +919,6 @@ catia_setxattr(vfs_handle_struct *handle, const char *path,
return ret;
}
static int
catia_lsetxattr(vfs_handle_struct *handle, const char *path,
const char *name, const void *value, size_t size,
int flags)
{
char *mapped_name = NULL;
NTSTATUS status;
ssize_t ret;
status = catia_string_replace_allocate(handle->conn,
name, &mapped_name, vfs_translate_to_unix);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
return -1;
}
ret = SMB_VFS_NEXT_LSETXATTR(handle, path, mapped_name, value, size, flags);
TALLOC_FREE(mapped_name);
return ret;
}
static struct vfs_fn_pointers vfs_catia_fns = {
.mkdir_fn = catia_mkdir,
.rmdir_fn = catia_rmdir,
@ -969,7 +946,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
.removexattr_fn = catia_removexattr,
.lremovexattr_fn = catia_lremovexattr,
.setxattr_fn = catia_setxattr,
.lsetxattr_fn = catia_lsetxattr,
};
NTSTATUS vfs_catia_init(void)

View File

@ -2043,11 +2043,6 @@ static int vfswrap_setxattr(struct vfs_handle_struct *handle, const char *path,
return sys_setxattr(path, name, value, size, flags);
}
static int vfswrap_lsetxattr(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
{
return sys_lsetxattr(path, 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)
{
return sys_fsetxattr(fsp->fh->fd, name, value, size, flags);
@ -2276,7 +2271,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
.lremovexattr_fn = vfswrap_lremovexattr,
.fremovexattr_fn = vfswrap_fremovexattr,
.setxattr_fn = vfswrap_setxattr,
.lsetxattr_fn = vfswrap_lsetxattr,
.fsetxattr_fn = vfswrap_fsetxattr,
/* aio operations */

View File

@ -198,7 +198,6 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_LREMOVEXATTR,
SMB_VFS_OP_FREMOVEXATTR,
SMB_VFS_OP_SETXATTR,
SMB_VFS_OP_LSETXATTR,
SMB_VFS_OP_FSETXATTR,
/* aio operations */
@ -327,7 +326,6 @@ static struct {
{ SMB_VFS_OP_LREMOVEXATTR, "lremovexattr" },
{ SMB_VFS_OP_FREMOVEXATTR, "fremovexattr" },
{ SMB_VFS_OP_SETXATTR, "setxattr" },
{ SMB_VFS_OP_LSETXATTR, "lsetxattr" },
{ SMB_VFS_OP_FSETXATTR, "fsetxattr" },
{ SMB_VFS_OP_AIO_READ, "aio_read" },
{ SMB_VFS_OP_AIO_WRITE, "aio_write" },
@ -2068,22 +2066,6 @@ static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
const char *path,
const char *name, const void *value, size_t size,
int flags)
{
int result;
result = SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size,
flags);
do_log(SMB_VFS_OP_LSETXATTR, (result >= 0), handle,
"%s|%s", path, 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)
@ -2315,7 +2297,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.lremovexattr_fn = smb_full_audit_lremovexattr,
.fremovexattr_fn = smb_full_audit_fremovexattr,
.setxattr_fn = smb_full_audit_setxattr,
.lsetxattr_fn = smb_full_audit_lsetxattr,
.fsetxattr_fn = smb_full_audit_fsetxattr,
.aio_read_fn = smb_full_audit_aio_read,
.aio_write_fn = smb_full_audit_aio_write,

View File

@ -605,16 +605,6 @@ onefs_shadow_copy_setxattr(vfs_handle_struct *handle, const char *path,
int);
}
static int
onefs_shadow_copy_lsetxattr(vfs_handle_struct *handle, const char *path,
const char *name, const void *value, size_t size,
int flags)
{
SHADOW_NEXT(LSETXATTR,
(handle, cpath ?: path, name, value, size, flags),
int);
}
static bool
onefs_shadow_copy_is_offline(struct vfs_handle_struct *handle,
const struct smb_fname *fname,

View File

@ -1435,37 +1435,6 @@ static int shadow_copy2_setxattr(struct vfs_handle_struct *handle,
return ret;
}
static int shadow_copy2_lsetxattr(struct vfs_handle_struct *handle,
const char *fname,
const char *aname, const void *value,
size_t size, int flags)
{
time_t timestamp;
char *stripped;
ssize_t ret;
int saved_errno;
char *conv;
if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
&timestamp, &stripped)) {
return -1;
}
if (timestamp == 0) {
return SMB_VFS_NEXT_LSETXATTR(handle, fname, aname, value,
size, flags);
}
conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
TALLOC_FREE(stripped);
if (conv == NULL) {
return -1;
}
ret = SMB_VFS_NEXT_LSETXATTR(handle, conv, aname, value, size, flags);
saved_errno = errno;
TALLOC_FREE(conv);
errno = saved_errno;
return ret;
}
static int shadow_copy2_chmod_acl(vfs_handle_struct *handle,
const char *fname, mode_t mode)
{
@ -1563,7 +1532,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
.removexattr_fn = shadow_copy2_removexattr,
.lremovexattr_fn = shadow_copy2_lremovexattr,
.setxattr_fn = shadow_copy2_setxattr,
.lsetxattr_fn = shadow_copy2_lsetxattr,
.chmod_acl_fn = shadow_copy2_chmod_acl,
.chflags_fn = shadow_copy2_chflags,
.get_real_filename_fn = shadow_copy2_get_real_filename,

View File

@ -2093,28 +2093,6 @@ static int smb_time_audit_setxattr(struct vfs_handle_struct *handle,
return result;
}
static int smb_time_audit_lsetxattr(struct vfs_handle_struct *handle,
const char *path, 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_LSETXATTR(handle, path, 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("lsetxattr", timediff);
}
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)
@ -2401,7 +2379,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.lremovexattr_fn = smb_time_audit_lremovexattr,
.fremovexattr_fn = smb_time_audit_fremovexattr,
.setxattr_fn = smb_time_audit_setxattr,
.lsetxattr_fn = smb_time_audit_lsetxattr,
.fsetxattr_fn = smb_time_audit_fsetxattr,
.aio_read_fn = smb_time_audit_aio_read,
.aio_write_fn = smb_time_audit_aio_write,

View File

@ -2202,15 +2202,6 @@ int smb_vfs_call_setxattr(struct vfs_handle_struct *handle, const char *path,
return handle->fns->setxattr_fn(handle, path, name, value, size, 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)
{
VFS_FIND(lsetxattr);
return handle->fns->lsetxattr_fn(handle, path, 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)

View File

@ -232,7 +232,7 @@ __closedir crypt16 delproplist devnm dgettext dirfd
DNSServiceRegister _dup __dup _dup2 __dup2 endmntent execl
extattr_delete_fd extattr_delete_link extattr_get_fd extattr_get_file
extattr_get_link extattr_list_fd extattr_list_file extattr_list_link
extattr_set_fd extattr_set_file extattr_set_link _facl __facl _fchdir
extattr_set_fd extattr_set_file _facl __facl _fchdir
__fchdir fchmod fchown _fcntl __fcntl fcvt fcvtl fdatasync
fdelproplist fgetea fgetproplist fgetxattr flistea flistxattr
_fork __fork fremoveea fremovexattr fseeko fsetea
@ -244,7 +244,7 @@ getproplist get_proplist_entry getpwanam getpwent_r getrlimit gettext
glob grantpt hstrerror initgroups innetgr
inotify_init listea listxattr
llseek _llseek __llseek lremoveea lremovexattr _lseek __lseek
lsetea lsetxattr _lstat __lstat lutimes
_lstat __lstat lutimes
__lxstat memalign mknod mlock mlockall munlock munlockall
_open __open _opendir __opendir
pathconf poll posix_fallocate