summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2015-09-15 21:25:09 +0300
committerMike Frysinger <vapier@gentoo.org>2015-09-22 11:07:53 -0400
commitefa0b1ea982261861d64f6d6d620af83d82b02d3 (patch)
treeaf5a73843fb4b47802e6af603fc6faccb68603b0
parent27b3fb209c4f5c72e8a558c12240cd1d75df529d (diff)
downloadattr-efa0b1ea982261861d64f6d6d620af83d82b02d3.tar.gz
Reintroduce symbols that used to be syscall wrappers
Commit 7921157890d07858d092f4003ca4c6bae9fd2c38 removed symbols that were part of ABI. Reintroduce these symbols to fix the ABI breakage. These backward compatibility symbols just use appropriate xattr syscall wrappers provided by libc.
-rw-r--r--libattr/Makemodule.am6
-rw-r--r--libattr/libattr.lds12
-rw-r--r--libattr/syscalls.c89
3 files changed, 106 insertions, 1 deletions
diff --git a/libattr/Makemodule.am b/libattr/Makemodule.am
index a5a0cdd..4b3720c 100644
--- a/libattr/Makemodule.am
+++ b/libattr/Makemodule.am
@@ -8,15 +8,19 @@ LT_CURRENT = 2
LT_AGE = 1
LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-libattr_la_DEPENDENCIES = exports
+libattr_la_DEPENDENCIES = exports libattr/libattr.lds
libattr_la_SOURCES = \
libattr/attr_copy_action.c \
libattr/attr_copy_check.c \
libattr/attr_copy_fd.c \
libattr/attr_copy_file.c \
libattr/libattr.c \
+ libattr/syscalls.c \
libattr/libattr.h
libattr_la_CFLAGS = -include libattr/libattr.h
libattr_la_LDFLAGS = \
-Wl,--version-script,$(top_srcdir)/exports \
+ -Wl,$(top_srcdir)/libattr/libattr.lds \
-version-info $(LTVERSION)
+
+EXTRA_DIST += libattr/libattr.lds
diff --git a/libattr/libattr.lds b/libattr/libattr.lds
new file mode 100644
index 0000000..947f15d
--- /dev/null
+++ b/libattr/libattr.lds
@@ -0,0 +1,12 @@
+"fgetxattr@ATTR_1.0" = libattr_fgetxattr;
+"flistxattr@ATTR_1.0" = libattr_flistxattr;
+"fremovexattr@ATTR_1.0" = libattr_fremovexattr;
+"fsetxattr@ATTR_1.0" = libattr_fsetxattr;
+"getxattr@ATTR_1.0" = libattr_getxattr;
+"lgetxattr@ATTR_1.0" = libattr_lgetxattr;
+"listxattr@ATTR_1.0" = libattr_listxattr;
+"llistxattr@ATTR_1.0" = libattr_llistxattr;
+"lremovexattr@ATTR_1.0" = libattr_lremovexattr;
+"lsetxattr@ATTR_1.0" = libattr_lsetxattr;
+"removexattr@ATTR_1.0" = libattr_removexattr;
+"setxattr@ATTR_1.0" = libattr_setxattr;
diff --git a/libattr/syscalls.c b/libattr/syscalls.c
new file mode 100644
index 0000000..5e7db67
--- /dev/null
+++ b/libattr/syscalls.c
@@ -0,0 +1,89 @@
+/*
+ Copyright (C) 2015 Dmitry V. Levin <ldv@altlinux.org>
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * These dumb wrappers are for backwards compatibility only.
+ * Actual syscall wrappers are long gone to libc.
+ */
+
+#include <sys/xattr.h>
+
+int libattr_setxattr(const char *path, const char *name,
+ void *value, size_t size, int flags)
+{
+ return setxattr(path, name, value, size, flags);
+}
+
+int libattr_lsetxattr(const char *path, const char *name,
+ void *value, size_t size, int flags)
+{
+ return lsetxattr(path, name, value, size, flags);
+}
+
+int libattr_fsetxattr(int filedes, const char *name,
+ void *value, size_t size, int flags)
+{
+ return fsetxattr(filedes, name, value, size, flags);
+}
+
+ssize_t libattr_getxattr(const char *path, const char *name,
+ void *value, size_t size)
+{
+ return getxattr(path, name, value, size);
+}
+
+ssize_t libattr_lgetxattr(const char *path, const char *name,
+ void *value, size_t size)
+{
+ return lgetxattr(path, name, value, size);
+}
+
+ssize_t libattr_fgetxattr(int filedes, const char *name,
+ void *value, size_t size)
+{
+ return fgetxattr(filedes, name, value, size);
+}
+
+ssize_t libattr_listxattr(const char *path, char *list, size_t size)
+{
+ return listxattr(path, list, size);
+}
+
+ssize_t libattr_llistxattr(const char *path, char *list, size_t size)
+{
+ return llistxattr(path, list, size);
+}
+
+ssize_t libattr_flistxattr(int filedes, char *list, size_t size)
+{
+ return flistxattr(filedes, list, size);
+}
+
+int libattr_removexattr(const char *path, const char *name)
+{
+ return removexattr(path, name);
+}
+
+int libattr_lremovexattr(const char *path, const char *name)
+{
+ return lremovexattr(path, name);
+}
+
+int libattr_fremovexattr(int filedes, const char *name)
+{
+ return fremovexattr(filedes, name);
+}