restore/dump-glibc_xattr.patch
DistroBaker 8bb28b7f83 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/dump.git#33119038a04d203fddd1a6c9d128098f0d911801
2021-02-22 14:03:53 +01:00

134 lines
4.1 KiB
Diff

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