diff --git a/SOURCES/dump-glibc_xattr.patch b/SOURCES/dump-glibc_xattr.patch new file mode 100644 index 0000000..ee0ec2b --- /dev/null +++ b/SOURCES/dump-glibc_xattr.patch @@ -0,0 +1,128 @@ +commit 3c7a1372a2ff3bd40d05cfca56af54cd1ae12321 +Author: Vaclav Dolezal +Date: Wed Mar 6 11:37:50 2019 +0100 + + Use xattr functions from libc + + Signed-off-by: Vaclav Dolezal + +diff --git a/restore/xattr.c b/restore/xattr.c +index ddabfa2..a176e7e 100644 +--- a/restore/xattr.c ++++ b/restore/xattr.c +@@ -36,6 +36,7 @@ static const char rcsid[] = + #include + #include + #include ++#include + #include + #include + #include +@@ -124,82 +125,6 @@ struct ext2_xattr_entry { + (entry)->e_value_offs + sizeof(struct ext3_xattr_ibody_header) : \ + (entry)->e_value_offs)) + +-/* +- * xattr syscalls do not exist yet in libc, get our own copy here, +- * taken from libattr. +- */ +-#if defined (__i386__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 227 +-# define __NR_lgetxattr 230 +-# define __NR_llistxattr 233 +-#elif defined (__sparc__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 170 +-# define __NR_lgetxattr 173 +-# define __NR_llistxattr 179 +-#elif defined (__ia64__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 1218 +-# define __NR_lgetxattr 1221 +-# define __NR_llistxattr 1224 +-#elif defined (__powerpc__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 210 +-# define __NR_lgetxattr 213 +-# define __NR_llistxattr 216 +-#elif defined (__x86_64__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 189 +-# define __NR_lgetxattr 192 +-# define __NR_llistxattr 195 +-#elif defined (__s390__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 225 +-# define __NR_lgetxattr 228 +-# define __NR_llistxattr 231 +-#elif defined (__arm__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_SYSCALL_BASE 0x900000 +-# define __NR_lsetxattr (__NR_SYSCALL_BASE+227) +-# define __NR_lgetxattr (__NR_SYSCALL_BASE+230) +-# define __NR_llistxattr (__NR_SYSCALL_BASE+233) +-#elif defined (__mips64__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_Linux 5000 +-# define __NR_lsetxattr (__NR_Linux + 218) +-# define __NR_lgetxattr (__NR_Linux + 221) +-# define __NR_llistxattr (__NR_Linux + 224) +-#elif defined (__mips__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_Linux 4000 +-# define __NR_lsetxattr (__NR_Linux + 225) +-# define __NR_lgetxattr (__NR_Linux + 228) +-# define __NR_llistxattr (__NR_Linux + 231) +-#elif defined (__alpha__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 383 +-# define __NR_lgetxattr 386 +-# define __NR_llistxattr 389 +-#elif defined (__mc68000__) +-# define HAVE_XATTR_SYSCALLS 1 +-# define __NR_lsetxattr 224 +-# define __NR_lgetxattr 227 +-# define __NR_llistxattr 230 +-#else +-# warning "Extended attribute syscalls undefined for this architecture" +-# define HAVE_XATTR_SYSCALLS 0 +-#endif +- +-#if HAVE_XATTR_SYSCALLS +-# define SYSCALL(args...) syscall(args) +-#else +-# define SYSCALL(args...) ( errno = ENOSYS, -1 ) +-#endif +- +-static int lsetxattr __P((const char *, const char *, void *, size_t, int)); +-static ssize_t lgetxattr __P((const char *, const char *, void *, size_t)); +-static ssize_t llistxattr __P((const char *, char *, size_t)); + static int xattr_cb_list __P((char *, char *, int, int, void *)); + static int xattr_cb_set __P((char *, char *, int, int, void *)); + static int xattr_cb_compare __P((char *, char *, int, int, void *)); +@@ -207,24 +132,6 @@ static int xattr_verify __P((char *)); + static int xattr_count __P((char *, int *)); + static int xattr_walk __P((char *, int (*)(char *, char *, int, int, void *), void *)); + +-static int +-lsetxattr(const char *path, const char *name, void *value, size_t size, int flags) +-{ +- return SYSCALL(__NR_lsetxattr, path, name, value, size, flags); +-} +- +-static ssize_t +-lgetxattr(const char *path, const char *name, void *value, size_t size) +-{ +- return SYSCALL(__NR_lgetxattr, path, name, value, size); +-} +- +-static ssize_t +-llistxattr(const char *path, char *list, size_t size) +-{ +- return SYSCALL(__NR_llistxattr, path, list, size); +-} +- + #define POSIX_ACL_XATTR_VERSION 0x0002 + + #define ACL_UNDEFINED_ID (-1) diff --git a/SPECS/dump.spec b/SPECS/dump.spec index d11fb80..1a7312e 100644 --- a/SPECS/dump.spec +++ b/SPECS/dump.spec @@ -5,7 +5,7 @@ Summary: Programs for backing up and restoring ext2/ext3 filesystems Name: dump Epoch: 1 Version: 0.4 -Release: 0.23.%{PREVER}%{?dist} +Release: 0.24.%{PREVER}%{?dist} License: BSD Group: Applications/Archiving URL: http://dump.sourceforge.net/ @@ -26,6 +26,7 @@ Patch1: dump-rh664616.patch Patch2: dump-aarch64.patch Patch3: dump-rmt-moved-star.patch Patch4: dump-restore-rmdir.patch +Patch5: dump-glibc_xattr.patch %description The dump package contains both dump and restore. Dump examines files @@ -47,6 +48,7 @@ restoring filesystems after backups. %patch2 -p1 -b .aarch64 %patch3 -p1 -b .rmt-moved-star %patch4 -p1 -b .restore-rmdir +%patch5 -p1 -b .glibc-xattr for i in THANKS MAINTAINERS COPYRIGHT CHANGES; do iconv -f iso-8859-1 -t utf-8 $i -o $i.new @@ -113,6 +115,9 @@ rm -rf %{buildroot} %{_mandir}/man8/rrestore.8* %changelog +* Tue Feb 04 2020 Václav Doležal - 1:0.4-0.24.b44 +- Use xattr functions from libc (#1532558) + * Wed Aug 30 2017 Josef Ridky - 1:0.4-0.23.b44 - fix issue with restoring incremental dump when a directory was removed (#1183264)