parent
afb758a902
commit
5c4fc05d8d
133
dump-glibc_xattr.patch
Normal file
133
dump-glibc_xattr.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From 996ac7b862d598ab77436bdff750718d00c714a9 Mon Sep 17 00:00:00 2001
|
||||
From: Vaclav Dolezal <vdolezal@redhat.com>
|
||||
Date: Wed, 6 Mar 2019 11:37:50 +0100
|
||||
Subject: [PATCH] Use xattr functions from libc
|
||||
|
||||
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
|
||||
---
|
||||
restore/xattr.c | 95 +------------------------------------------------
|
||||
1 file changed, 1 insertion(+), 94 deletions(-)
|
||||
|
||||
diff --git a/restore/xattr.c b/restore/xattr.c
|
||||
index 0c1b547..9f80da6 100644
|
||||
--- a/restore/xattr.c
|
||||
+++ b/restore/xattr.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <config.h>
|
||||
#include <compaterr.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/xattr.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -118,82 +119,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 (const char *, const char *, void *, size_t, int);
|
||||
-static ssize_t lgetxattr (const char *, const char *, void *, size_t);
|
||||
-static ssize_t llistxattr (const char *, char *, size_t);
|
||||
static int xattr_cb_list (char *, char *, int, int, void *);
|
||||
static int xattr_cb_set (char *, char *, int, int, void *);
|
||||
static int xattr_cb_compare (char *, char *, int, int, void *);
|
||||
@@ -201,24 +126,6 @@ static int xattr_verify (char *);
|
||||
static int xattr_count (char *, int *);
|
||||
static int xattr_walk (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)
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -7,7 +7,7 @@ Summary: Programs for backing up and restoring ext2/ext3/ext4 filesystems
|
||||
Name: dump
|
||||
Epoch: 1
|
||||
Version: 0.4
|
||||
Release: 0.42.%{PREVER}%{?dist}
|
||||
Release: 0.43.%{PREVER}%{?dist}
|
||||
License: BSD
|
||||
URL: http://dump.sourceforge.net/
|
||||
Source: http://downloads.sourceforge.net/dump/dump-%{DUMP_VERSION}.tar.gz
|
||||
@ -25,6 +25,7 @@ Provides: dump-static
|
||||
|
||||
Patch0: dump-buildfix.patch
|
||||
Patch1: dump-remove-lzo.patch
|
||||
Patch2: dump-glibc_xattr.patch
|
||||
|
||||
%description
|
||||
The dump package contains both dump and restore. Dump examines files
|
||||
@ -43,6 +44,7 @@ restoring filesystems after backups.
|
||||
|
||||
%patch0 -p1 -b .buildfix
|
||||
%patch1 -p1 -b .remove-lzo
|
||||
%patch2 -p1 -b .glibc_xattr
|
||||
|
||||
for i in MAINTAINERS COPYING ChangeLog; do
|
||||
iconv -f iso-8859-1 -t utf-8 $i -o $i.new
|
||||
@ -105,6 +107,9 @@ popd
|
||||
%{_mandir}/man8/rrestore.8*
|
||||
|
||||
%changelog
|
||||
* Wed Feb 12 2020 Václav Doležal <vdolezal@redhat.com> - 1:0.4-0.43.b46
|
||||
- Use library functions for manipulating xattrs (#1795953)
|
||||
|
||||
* Tue Feb 04 2020 Václav Doležal <vdolezal@redhat.com> - 1:0.4-0.42.b46
|
||||
- Fix FTBFS by enabling '-fcommon'
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user