From c5b17c555576a2b8e24e0df613dde922fe60520d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 Apr 2012 08:26:22 +1000 Subject: s3-vfs: Remove unused llistxattr 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 --- docs-xml/manpages-3/vfs_full_audit.8.xml | 1 - examples/VFS/skel_opaque.c | 7 ------- examples/VFS/skel_transparent.c | 6 ------ source3/configure.in | 4 ++-- source3/include/proto.h | 1 - source3/include/vfs.h | 2 +- source3/include/vfs_macros.h | 5 ----- source3/lib/system.c | 29 ----------------------------- source3/modules/vfs_cap.c | 12 ------------ source3/modules/vfs_catia.c | 23 ----------------------- source3/modules/vfs_default.c | 6 ------ source3/modules/vfs_full_audit.c | 15 --------------- source3/modules/vfs_onefs_shadow_copy.c | 10 ---------- source3/modules/vfs_time_audit.c | 21 --------------------- source3/smbd/vfs.c | 7 ------- source3/wscript | 2 +- 16 files changed, 4 insertions(+), 147 deletions(-) diff --git a/docs-xml/manpages-3/vfs_full_audit.8.xml b/docs-xml/manpages-3/vfs_full_audit.8.xml index d77d0234dd..f142f87b9d 100644 --- a/docs-xml/manpages-3/vfs_full_audit.8.xml +++ b/docs-xml/manpages-3/vfs_full_audit.8.xml @@ -77,7 +77,6 @@ link linux_setlease listxattr - llistxattr lock lremovexattr lseek diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 924947afff..50a8e2908c 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -680,12 +680,6 @@ static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char return -1; } -static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) -{ - errno = ENOSYS; - return -1; -} - static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) { errno = ENOSYS; @@ -908,7 +902,6 @@ struct vfs_fn_pointers skel_opaque_fns = { .getxattr_fn = skel_getxattr, .fgetxattr_fn = skel_fgetxattr, .listxattr_fn = skel_listxattr, - .llistxattr_fn = skel_llistxattr, .flistxattr_fn = skel_flistxattr, .removexattr_fn = skel_removexattr, .lremovexattr_fn = skel_lremovexattr, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 29923d8083..932888e2de 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -656,11 +656,6 @@ static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char return SMB_VFS_NEXT_LISTXATTR(handle, path, list, size); } -static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) -{ - return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); -} - static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) { return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size); @@ -865,7 +860,6 @@ struct vfs_fn_pointers skel_transparent_fns = { .getxattr_fn = skel_getxattr, .fgetxattr_fn = skel_fgetxattr, .listxattr_fn = skel_listxattr, - .llistxattr_fn = skel_llistxattr, .flistxattr_fn = skel_flistxattr, .removexattr_fn = skel_removexattr, .lremovexattr_fn = skel_lremovexattr, diff --git a/source3/configure.in b/source3/configure.in index 58dd1c2307..c4f724b17d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1301,10 +1301,10 @@ case "$host_os" in *) AC_SEARCH_LIBS(getxattr, [attr]) AC_CHECK_FUNCS(getxattr,[ - AC_CHECK_FUNCS(fgetxattr listxattr llistxattr flistxattr removexattr lremovexattr fremovexattr setxattr lsetxattr fsetxattr) + AC_CHECK_FUNCS(fgetxattr listxattr flistxattr removexattr lremovexattr fremovexattr setxattr lsetxattr fsetxattr) ]) AC_CHECK_FUNCS(getea,[ - AC_CHECK_FUNCS(fgetea lgetea listea flistea llistea removeea fremoveea lremoveea setea fsetea lsetea) + AC_CHECK_FUNCS(fgetea lgetea listea flistea removeea fremoveea lremoveea setea fsetea lsetea) ]) AC_CHECK_FUNCS(attr_get,[ AC_CHECK_FUNCS(attr_list attr_set attr_remove attr_getf attr_listf attr_setf attr_removef) diff --git a/source3/include/proto.h b/source3/include/proto.h index 2872ada33d..5bfd05cb53 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -353,7 +353,6 @@ int sys_pclose(int fd); ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size); ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size); ssize_t sys_listxattr (const char *path, char *list, size_t size); -ssize_t sys_llistxattr (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); diff --git a/source3/include/vfs.h b/source3/include/vfs.h index d1aa9e96dc..258bec9275 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -138,6 +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 */ #define SMB_VFS_INTERFACE_VERSION 29 /* @@ -400,7 +401,6 @@ struct vfs_fn_pointers { ssize_t (*getxattr_fn)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); ssize_t (*fgetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size); ssize_t (*listxattr_fn)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); - ssize_t (*llistxattr_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); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index e35630a629..6af662c1f4 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -529,11 +529,6 @@ #define SMB_VFS_NEXT_LISTXATTR(handle,path,list,size) \ smb_vfs_call_listxattr((handle)->next,(path),(list),(size)) -#define SMB_VFS_LLISTXATTR(conn,path,list,size) \ - smb_vfs_call_llistxattr((conn)->vfs_handles,(path),(list),(size)) -#define SMB_VFS_NEXT_LLISTXATTR(handle,path,list,size) \ - smb_vfs_call_llistxattr((handle)->next,(path),(list),(size)) - #define SMB_VFS_FLISTXATTR(fsp,list,size) \ smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size)) #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,list,size) \ diff --git a/source3/lib/system.c b/source3/lib/system.c index 70df46605d..ed5cf0cec8 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1610,35 +1610,6 @@ ssize_t sys_listxattr (const char *path, char *list, size_t size) #endif } -ssize_t sys_llistxattr (const char *path, char *list, size_t size) -{ -#if defined(HAVE_LLISTXATTR) - return llistxattr(path, list, size); -#elif defined(HAVE_LISTXATTR) && defined(XATTR_ADD_OPT) - int options = XATTR_NOFOLLOW; - return listxattr(path, list, size, options); -#elif defined(HAVE_LLISTEA) - return llistea(path, list, size); -#elif defined(HAVE_EXTATTR_LIST_LINK) - extattr_arg arg; - arg.path = path; - return bsd_attr_list(1, arg, list, size); -#elif defined(HAVE_ATTR_LIST) && defined(HAVE_SYS_ATTRIBUTES_H) - return irix_attr_list(path, 0, list, size, ATTR_DONTFOLLOW); -#elif defined(HAVE_ATTROPEN) - ssize_t ret = -1; - int attrdirfd = solaris_attropen(path, ".", O_RDONLY|AT_SYMLINK_NOFOLLOW, 0); - if (attrdirfd >= 0) { - ret = solaris_list_xattr(attrdirfd, list, size); - close(attrdirfd); - } - return ret; -#else - errno = ENOSYS; - return -1; -#endif -} - ssize_t sys_flistxattr (int filedes, char *list, size_t size) { #if defined(HAVE_FLISTXATTR) diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 716e5dce80..125b5f43da 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -476,17 +476,6 @@ static ssize_t cap_listxattr(vfs_handle_struct *handle, const char *path, char * return SMB_VFS_NEXT_LISTXATTR(handle, cappath, list, size); } -static ssize_t cap_llistxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) -{ - char *cappath = capencode(talloc_tos(), path); - - if (!cappath) { - errno = ENOMEM; - return -1; - } - return SMB_VFS_NEXT_LLISTXATTR(handle, cappath, list, size); -} - static int cap_removexattr(vfs_handle_struct *handle, const char *path, const char *name) { char *cappath = capencode(talloc_tos(), path); @@ -585,7 +574,6 @@ static struct vfs_fn_pointers vfs_cap_fns = { .getxattr_fn = cap_getxattr, .fgetxattr_fn = cap_fgetxattr, .listxattr_fn = cap_listxattr, - .llistxattr_fn = cap_llistxattr, .removexattr_fn = cap_removexattr, .lremovexattr_fn = cap_lremovexattr, .fremovexattr_fn = cap_fremovexattr, diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index c34edf7073..687547dc17 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -852,28 +852,6 @@ catia_listxattr(vfs_handle_struct *handle, const char *path, return ret; } -static ssize_t -catia_llistxattr(vfs_handle_struct *handle, const char *path, - char *list, size_t size) -{ - char *mapped_name = NULL; - NTSTATUS status; - ssize_t ret; - - status = catia_string_replace_allocate(handle->conn, - path, &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_LLISTXATTR(handle, mapped_name, list, size); - TALLOC_FREE(mapped_name); - - return ret; -} - static int catia_removexattr(vfs_handle_struct *handle, const char *path, const char *name) @@ -988,7 +966,6 @@ static struct vfs_fn_pointers vfs_catia_fns = { .sys_acl_delete_def_file_fn = catia_sys_acl_delete_def_file, .getxattr_fn = catia_getxattr, .listxattr_fn = catia_listxattr, - .llistxattr_fn = catia_llistxattr, .removexattr_fn = catia_removexattr, .lremovexattr_fn = catia_lremovexattr, .setxattr_fn = catia_setxattr, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index ed1ee707e2..a7abe0ba42 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2018,11 +2018,6 @@ static ssize_t vfswrap_listxattr(struct vfs_handle_struct *handle, const char *p return sys_listxattr(path, list, size); } -static ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size) -{ - return sys_llistxattr(path, list, size); -} - static ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) { return sys_flistxattr(fsp->fh->fd, list, size); @@ -2276,7 +2271,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .getxattr_fn = vfswrap_getxattr, .fgetxattr_fn = vfswrap_fgetxattr, .listxattr_fn = vfswrap_listxattr, - .llistxattr_fn = vfswrap_llistxattr, .flistxattr_fn = vfswrap_flistxattr, .removexattr_fn = vfswrap_removexattr, .lremovexattr_fn = vfswrap_lremovexattr, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index a35c210d2b..8c7e0f36cc 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -193,7 +193,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_GETXATTR, SMB_VFS_OP_FGETXATTR, SMB_VFS_OP_LISTXATTR, - SMB_VFS_OP_LLISTXATTR, SMB_VFS_OP_FLISTXATTR, SMB_VFS_OP_REMOVEXATTR, SMB_VFS_OP_LREMOVEXATTR, @@ -323,7 +322,6 @@ static struct { { SMB_VFS_OP_GETXATTR, "getxattr" }, { SMB_VFS_OP_FGETXATTR, "fgetxattr" }, { SMB_VFS_OP_LISTXATTR, "listxattr" }, - { SMB_VFS_OP_LLISTXATTR, "llistxattr" }, { SMB_VFS_OP_FLISTXATTR, "flistxattr" }, { SMB_VFS_OP_REMOVEXATTR, "removexattr" }, { SMB_VFS_OP_LREMOVEXATTR, "lremovexattr" }, @@ -1998,18 +1996,6 @@ static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, - const char *path, char *list, size_t size) -{ - ssize_t result; - - result = SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); - - do_log(SMB_VFS_OP_LLISTXATTR, (result >= 0), handle, "%s", path); - - return result; -} - static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) @@ -2324,7 +2310,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .getxattr_fn = smb_full_audit_getxattr, .fgetxattr_fn = smb_full_audit_fgetxattr, .listxattr_fn = smb_full_audit_listxattr, - .llistxattr_fn = smb_full_audit_llistxattr, .flistxattr_fn = smb_full_audit_flistxattr, .removexattr_fn = smb_full_audit_removexattr, .lremovexattr_fn = smb_full_audit_lremovexattr, diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c index 09df2f8f3e..410859a046 100644 --- a/source3/modules/vfs_onefs_shadow_copy.c +++ b/source3/modules/vfs_onefs_shadow_copy.c @@ -577,15 +577,6 @@ onefs_shadow_copy_listxattr(vfs_handle_struct *handle, const char *path, ssize_t); } -static ssize_t -onefs_shadow_copy_llistxattr(vfs_handle_struct *handle, const char *path, - char *list, size_t size) -{ - SHADOW_NEXT(LLISTXATTR, - (handle, cpath ?: path, list, size), - ssize_t); -} - static int onefs_shadow_copy_removexattr(vfs_handle_struct *handle, const char *path, const char *name) @@ -681,7 +672,6 @@ static struct vfs_fn_pointers onefs_shadow_copy_fns = { .sys_acl_delete_def_file_fn = onefs_shadow_copy_sys_acl_delete_def_file, .getxattr_fn = onefs_shadow_copy_getxattr, .listxattr_fn = onefs_shadow_copy_listxattr, - .llistxattr_fn = onefs_shadow_copy_llistxattr, .removexattr_fn = onefs_shadow_copy_removexattr, .lremovexattr_fn = onefs_shadow_copy_lremovexattr, .setxattr_fn = onefs_shadow_copy_setxattr, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 8d7c7439f2..4064bccfbc 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1993,26 +1993,6 @@ static ssize_t smb_time_audit_listxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t smb_time_audit_llistxattr(struct vfs_handle_struct *handle, - const char *path, char *list, - size_t size) -{ - ssize_t result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log("llistxattr", timediff); - } - - return result; -} - static ssize_t smb_time_audit_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) @@ -2416,7 +2396,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .getxattr_fn = smb_time_audit_getxattr, .fgetxattr_fn = smb_time_audit_fgetxattr, .listxattr_fn = smb_time_audit_listxattr, - .llistxattr_fn = smb_time_audit_llistxattr, .flistxattr_fn = smb_time_audit_flistxattr, .removexattr_fn = smb_time_audit_removexattr, .lremovexattr_fn = smb_time_audit_lremovexattr, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 93c268f6fa..2c5a0b8a89 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2165,13 +2165,6 @@ ssize_t smb_vfs_call_listxattr(struct vfs_handle_struct *handle, return handle->fns->listxattr_fn(handle, path, list, size); } -ssize_t smb_vfs_call_llistxattr(struct vfs_handle_struct *handle, - const char *path, char *list, size_t size) -{ - VFS_FIND(llistxattr); - return handle->fns->llistxattr_fn(handle, path, list, size); -} - ssize_t smb_vfs_call_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size) diff --git a/source3/wscript b/source3/wscript index dcf2b9d415..3eabed0e43 100644 --- a/source3/wscript +++ b/source3/wscript @@ -242,7 +242,7 @@ getcwd _getcwd __getcwd getdents __getdents getdirentries getgrent getgrnam getgrouplist getgrset getmntent getpagesize getproplist get_proplist_entry getpwanam getpwent_r getrlimit gettext glob grantpt hstrerror initgroups innetgr -inotify_init listea listxattr llistea llistxattr +inotify_init listea listxattr llseek _llseek __llseek lremoveea lremovexattr _lseek __lseek lsetea lsetxattr _lstat __lstat lutimes __lxstat memalign mknod mlock mlockall munlock munlockall -- cgit