If this is ever needed again, it would be more appropriate as an options argument
to removexattr.
Andrew Bartlett
<member>linux_setlease</member>
<member>listxattr</member>
<member>lock</member>
- <member>lremovexattr</member>
<member>lseek</member>
<member>lstat</member>
<member>mkdir</member>
return -1;
}
-static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
-{
- errno = ENOSYS;
- return -1;
-}
-
static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
{
errno = ENOSYS;
.listxattr_fn = skel_listxattr,
.flistxattr_fn = skel_flistxattr,
.removexattr_fn = skel_removexattr,
- .lremovexattr_fn = skel_lremovexattr,
.fremovexattr_fn = skel_fremovexattr,
.setxattr_fn = skel_setxattr,
.fsetxattr_fn = skel_fsetxattr,
return SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
}
-static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
-{
- return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
-}
-
static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
{
return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
.listxattr_fn = skel_listxattr,
.flistxattr_fn = skel_flistxattr,
.removexattr_fn = skel_removexattr,
- .lremovexattr_fn = skel_lremovexattr,
.fremovexattr_fn = skel_fremovexattr,
.setxattr_fn = skel_setxattr,
.fsetxattr_fn = skel_fsetxattr,
*)
AC_SEARCH_LIBS(getxattr, [attr])
AC_CHECK_FUNCS(getxattr,[
- AC_CHECK_FUNCS(fgetxattr listxattr flistxattr removexattr lremovexattr fremovexattr setxattr fsetxattr)
+ AC_CHECK_FUNCS(fgetxattr listxattr flistxattr removexattr fremovexattr setxattr fsetxattr)
])
AC_CHECK_FUNCS(getea,[
- AC_CHECK_FUNCS(fgetea lgetea listea flistea removeea fremoveea lremoveea setea fsetea)
+ AC_CHECK_FUNCS(fgetea lgetea listea flistea removeea fremoveea 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)
+ AC_CHECK_FUNCS(extattr_delete_fd 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
ssize_t sys_listxattr (const char *path, char *list, size_t size);
ssize_t sys_flistxattr (int filedes, char *list, size_t size);
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_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
ssize_t (*listxattr_fn)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
ssize_t (*flistxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
int (*removexattr_fn)(struct vfs_handle_struct *handle, const char *path, const char *name);
- 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 (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags);
size_t size);
int smb_vfs_call_removexattr(struct vfs_handle_struct *handle,
const char *path, const char *name);
-int smb_vfs_call_lremovexattr(struct vfs_handle_struct *handle,
- const char *path, 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 char *path,
#define SMB_VFS_NEXT_REMOVEXATTR(handle,path,name) \
smb_vfs_call_removexattr((handle)->next,(path),(name))
-#define SMB_VFS_LREMOVEXATTR(conn,path,name) \
- smb_vfs_call_lremovexattr((conn)->vfs_handles,(path),(name))
-#define SMB_VFS_NEXT_LREMOVEXATTR(handle,path,name) \
- smb_vfs_call_lremovexattr((handle)->next,(path),(name))
-
#define SMB_VFS_FREMOVEXATTR(fsp,name) \
smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name))
#define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,name) \
#endif
}
-int sys_lremovexattr (const char *path, const char *name)
-{
-#if defined(HAVE_LREMOVEXATTR)
- return lremovexattr(path, name);
-#elif defined(HAVE_REMOVEXATTR) && defined(XATTR_ADD_OPT)
- int options = XATTR_NOFOLLOW;
- return removexattr(path, name, options);
-#elif defined(HAVE_LREMOVEEA)
- return lremoveea(path, name);
-#elif defined(HAVE_EXTATTR_DELETE_LINK)
- char *s;
- int attrnamespace = (strncmp(name, "system", 6) == 0) ?
- EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER;
- const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1;
-
- return extattr_delete_link(path, attrnamespace, attrname);
-#elif defined(HAVE_ATTR_REMOVE)
- int flags = ATTR_DONTFOLLOW;
- char *attrname = strchr(name,'.') + 1;
-
- if (strncmp(name, "system", 6) == 0) flags |= ATTR_ROOT;
-
- return attr_remove(path, attrname, flags);
-#elif defined(HAVE_ATTROPEN)
- int ret = -1;
- int attrdirfd = solaris_attropen(path, ".", O_RDONLY|AT_SYMLINK_NOFOLLOW, 0);
- if (attrdirfd >= 0) {
- ret = solaris_unlinkat(attrdirfd, name);
- close(attrdirfd);
- }
- return ret;
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
-
int sys_fremovexattr (int filedes, const char *name)
{
#if defined(HAVE_FREMOVEXATTR)
return SMB_VFS_NEXT_REMOVEXATTR(handle, cappath, capname);
}
-static int cap_lremovexattr(vfs_handle_struct *handle, const char *path, const char *name)
-{
- char *cappath = capencode(talloc_tos(), path);
- char *capname = capencode(talloc_tos(), name);
-
- if (!cappath || !capname) {
- errno = ENOMEM;
- return -1;
- }
- return SMB_VFS_NEXT_LREMOVEXATTR(handle, cappath, capname);
-}
-
static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path)
{
char *cappath = capencode(talloc_tos(), path);
.fgetxattr_fn = cap_fgetxattr,
.listxattr_fn = cap_listxattr,
.removexattr_fn = cap_removexattr,
- .lremovexattr_fn = cap_lremovexattr,
.fremovexattr_fn = cap_fremovexattr,
.setxattr_fn = cap_setxattr,
.fsetxattr_fn = cap_fsetxattr
return ret;
}
-static int
-catia_lremovexattr(vfs_handle_struct *handle, const char *path,
- const char *name)
-{
- 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_LREMOVEXATTR(handle, path, mapped_name);
- TALLOC_FREE(mapped_name);
-
- return ret;
-}
-
static int
catia_setxattr(vfs_handle_struct *handle, const char *path,
const char *name, const void *value, size_t size,
.getxattr_fn = catia_getxattr,
.listxattr_fn = catia_listxattr,
.removexattr_fn = catia_removexattr,
- .lremovexattr_fn = catia_lremovexattr,
.setxattr_fn = catia_setxattr,
};
return sys_removexattr(path, name);
}
-static int vfswrap_lremovexattr(struct vfs_handle_struct *handle, const char *path, const char *name)
-{
- return sys_lremovexattr(path, name);
-}
-
static int vfswrap_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
{
return sys_fremovexattr(fsp->fh->fd, name);
.listxattr_fn = vfswrap_listxattr,
.flistxattr_fn = vfswrap_flistxattr,
.removexattr_fn = vfswrap_removexattr,
- .lremovexattr_fn = vfswrap_lremovexattr,
.fremovexattr_fn = vfswrap_fremovexattr,
.setxattr_fn = vfswrap_setxattr,
.fsetxattr_fn = vfswrap_fsetxattr,
SMB_VFS_OP_LISTXATTR,
SMB_VFS_OP_FLISTXATTR,
SMB_VFS_OP_REMOVEXATTR,
- SMB_VFS_OP_LREMOVEXATTR,
SMB_VFS_OP_FREMOVEXATTR,
SMB_VFS_OP_SETXATTR,
SMB_VFS_OP_FSETXATTR,
{ SMB_VFS_OP_LISTXATTR, "listxattr" },
{ SMB_VFS_OP_FLISTXATTR, "flistxattr" },
{ SMB_VFS_OP_REMOVEXATTR, "removexattr" },
- { SMB_VFS_OP_LREMOVEXATTR, "lremovexattr" },
{ SMB_VFS_OP_FREMOVEXATTR, "fremovexattr" },
{ SMB_VFS_OP_SETXATTR, "setxattr" },
{ SMB_VFS_OP_FSETXATTR, "fsetxattr" },
return result;
}
-static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
- const char *path,
- const char *name)
-{
- int result;
-
- result = SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
-
- do_log(SMB_VFS_OP_LREMOVEXATTR, (result >= 0), handle,
- "%s|%s", path, name);
-
- return result;
-}
-
static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *name)
.listxattr_fn = smb_full_audit_listxattr,
.flistxattr_fn = smb_full_audit_flistxattr,
.removexattr_fn = smb_full_audit_removexattr,
- .lremovexattr_fn = smb_full_audit_lremovexattr,
.fremovexattr_fn = smb_full_audit_fremovexattr,
.setxattr_fn = smb_full_audit_setxattr,
.fsetxattr_fn = smb_full_audit_fsetxattr,
int);
}
-static int
-onefs_shadow_copy_lremovexattr(vfs_handle_struct *handle, const char *path,
- const char *name)
-{
- SHADOW_NEXT(LREMOVEXATTR,
- (handle, cpath ?: path, name),
- int);
-}
-
static int
onefs_shadow_copy_setxattr(vfs_handle_struct *handle, const char *path,
const char *name, const void *value, size_t size,
.getxattr_fn = onefs_shadow_copy_getxattr,
.listxattr_fn = onefs_shadow_copy_listxattr,
.removexattr_fn = onefs_shadow_copy_removexattr,
- .lremovexattr_fn = onefs_shadow_copy_lremovexattr,
.setxattr_fn = onefs_shadow_copy_setxattr,
.lsetxattr_fn = onefs_shadow_copy_lsetxattr,
.is_offline_fn = onefs_shadow_copy_is_offline,
return ret;
}
-static int shadow_copy2_lremovexattr(vfs_handle_struct *handle,
- const char *fname, const char *aname)
-{
- time_t timestamp;
- char *stripped;
- int ret, saved_errno;
- char *conv;
-
- if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
- ×tamp, &stripped)) {
- return -1;
- }
- if (timestamp == 0) {
- return SMB_VFS_NEXT_LREMOVEXATTR(handle, fname, aname);
- }
- conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
- TALLOC_FREE(stripped);
- if (conv == NULL) {
- return -1;
- }
- ret = SMB_VFS_NEXT_LREMOVEXATTR(handle, conv, aname);
- saved_errno = errno;
- TALLOC_FREE(conv);
- errno = saved_errno;
- return ret;
-}
-
static int shadow_copy2_setxattr(struct vfs_handle_struct *handle,
const char *fname,
const char *aname, const void *value,
.getxattr_fn = shadow_copy2_getxattr,
.listxattr_fn = shadow_copy2_listxattr,
.removexattr_fn = shadow_copy2_removexattr,
- .lremovexattr_fn = shadow_copy2_lremovexattr,
.setxattr_fn = shadow_copy2_setxattr,
.chmod_acl_fn = shadow_copy2_chmod_acl,
.chflags_fn = shadow_copy2_chflags,
return result;
}
-static int smb_time_audit_lremovexattr(struct vfs_handle_struct *handle,
- const char *path, const char *name)
-{
- int result;
- struct timespec ts1,ts2;
- double timediff;
-
- clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
- clock_gettime_mono(&ts2);
- timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
- if (timediff > audit_timeout) {
- smb_time_audit_log("lremovexattr", timediff);
- }
-
- return result;
-}
-
static int smb_time_audit_fremovexattr(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *name)
.listxattr_fn = smb_time_audit_listxattr,
.flistxattr_fn = smb_time_audit_flistxattr,
.removexattr_fn = smb_time_audit_removexattr,
- .lremovexattr_fn = smb_time_audit_lremovexattr,
.fremovexattr_fn = smb_time_audit_fremovexattr,
.setxattr_fn = smb_time_audit_setxattr,
.fsetxattr_fn = smb_time_audit_fsetxattr,
return handle->fns->removexattr_fn(handle, path, name);
}
-int smb_vfs_call_lremovexattr(struct vfs_handle_struct *handle,
- const char *path, const char *name)
-{
- VFS_FIND(lremovexattr);
- return handle->fns->lremovexattr_fn(handle, path, name);
-}
-
int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle,
struct files_struct *fsp, const char *name)
{
bindtextdomain _chdir __chdir chflags chmod _close __close _closedir
__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_delete_fd extattr_get_fd extattr_get_file
extattr_get_link extattr_list_fd extattr_list_file
extattr_set_fd extattr_set_file _facl __facl _fchdir
__fchdir fchmod fchown _fcntl __fcntl fcvt fcvtl fdatasync
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
+llseek _llseek __llseek _lseek __lseek
_lstat __lstat lutimes
__lxstat memalign mknod mlock mlockall munlock munlockall
_open __open _opendir __opendir