[Fakeroot-commits] [SCM] Debian packaging of fakeroot branch, upstream, updated. 63fbf30376b81f2d8a540d36cd3ab223a15c406f
Kyle J. McKay
mackyle at gmail.com
Fri May 17 00:11:17 UTC 2013
The following commit has been merged in the upstream branch:
commit 7f59338642ce9e79105924e2165ccf5f3818b585
Author: Kyle J. McKay <mackyle at gmail.com>
Date: Sat Nov 3 20:53:02 2012 -0700
Wrap all *xattr additions inside HAVE_ tests
diff --git a/configure.ac b/configure.ac
index 6cf46ed..c003e4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,6 +288,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
AC_CHECK_FUNCS(fchmodat fchownat fstatat mkdirat mknodat openat renameat unlinkat lchmod fgetattrlist)
+AC_CHECK_FUNCS(capset listxattr llistxattr flistxattr getxattr lgetxattr fgetxattr setxattr lsetxattr fsetxattr removexattr lremovexattr fremovexattr)
+
dnl find out how stat() etc are called. On linux systems, we really
dnl need to wrap (IIRC):
dnl Linux : __xstat
diff --git a/faked.c b/faked.c
index 66e0b32..a0f92ca 100644
--- a/faked.c
+++ b/faked.c
@@ -877,6 +877,7 @@ void process_unlink(struct fake_msg *buf){
void process_listxattr(struct fake_msg *buf)
{
+#if defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR)
data_node_t *i;
xattr_node_t *x = NULL;
@@ -912,10 +913,12 @@ void process_listxattr(struct fake_msg *buf)
}
}
faked_send_fakem(buf);
+#endif /* defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR) */
}
void process_setxattr(struct fake_msg *buf)
{
+#if defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR)
data_node_t *i;
xattr_node_t *x = NULL;
xattr_node_t **x_ref = NULL;
@@ -979,10 +982,12 @@ void process_setxattr(struct fake_msg *buf)
}
buf->xattr.buffersize = 0;
faked_send_fakem(buf);
+#endif /* defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR) */
}
void process_getxattr(struct fake_msg *buf)
{
+#if defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR) || defined(HAVE_FGETXATTR)
data_node_t *i;
xattr_node_t *x = NULL;
@@ -1008,10 +1013,12 @@ void process_getxattr(struct fake_msg *buf)
buf->xattr.flags_rc = 0;
}
faked_send_fakem(buf);
+#endif /* defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR) || defined(HAVE_FGETXATTR) */
}
void process_removexattr(struct fake_msg *buf)
{
+#if defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR)
data_node_t *i;
xattr_node_t *x = NULL;
@@ -1036,6 +1043,7 @@ void process_removexattr(struct fake_msg *buf)
}
buf->xattr.buffersize = 0;
faked_send_fakem(buf);
+#endif /* defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) */
}
void debugdata(int dummy UNUSED){
diff --git a/libfakeroot.c b/libfakeroot.c
index 8d191e5..14de8e1 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1544,12 +1544,15 @@ int setgroups(SETGROUPS_SIZE_TYPE size, const gid_t *list){
return 0;
}
+#ifdef HAVE_CAPSET
int capset(cap_user_header_t hdrp, const cap_user_data_t datap)
{
int rc = next_capset(hdrp, datap);
return (fakeroot_disabled) ? (rc) : 0;
}
+#endif /* HAVE_CAPSET */
+#if defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR)
static size_t common_setxattr(INT_STRUCT_STAT *st, const char *name, void * value, size_t size, int flags)
{
xattr_args xattr;
@@ -1566,7 +1569,9 @@ static size_t common_setxattr(INT_STRUCT_STAT *st, const char *name, void * valu
}
return 0;
}
+#endif /* defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) || defined(HAVE_FSETXATTR) */
+#if defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR) || defined(HAVE_FGETXATTR)
static size_t common_getxattr(INT_STRUCT_STAT *st, const char *name, void * value, size_t size)
{
xattr_args xattr;
@@ -1582,7 +1587,9 @@ static size_t common_getxattr(INT_STRUCT_STAT *st, const char *name, void * valu
}
return xattr.size;
}
+#endif /* defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR) || defined(HAVE_FGETXATTR) */
+#if defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR)
static size_t common_listxattr(INT_STRUCT_STAT *st, char *list, size_t size)
{
xattr_args xattr;
@@ -1598,7 +1605,9 @@ static size_t common_listxattr(INT_STRUCT_STAT *st, char *list, size_t size)
}
return xattr.size;
}
+#endif /* defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR) || defined(HAVE_FLISTXATTR) */
+#if defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR)
static size_t common_removexattr(INT_STRUCT_STAT *st, const char *name)
{
xattr_args xattr;
@@ -1614,7 +1623,9 @@ static size_t common_removexattr(INT_STRUCT_STAT *st, const char *name)
}
return 0;
}
+#endif /* defined(HAVE_REMOVEXATTR) || defined(HAVE_LREMOVEXATTR) || defined(HAVE_FREMOVEXATTR) */
+#ifdef HAVE_SETXATTR
ssize_t setxattr(const char *path, const char *name, void *value, size_t size, int flags)
{
INT_STRUCT_STAT st;
@@ -1633,7 +1644,9 @@ ssize_t setxattr(const char *path, const char *name, void *value, size_t size, i
return common_setxattr(&st, name, value, size, flags);
}
+#endif /* HAVE_SETXATTR */
+#ifdef HAVE_LSETXATTR
ssize_t lsetxattr(const char *path, const char *name, void *value, size_t size, int flags)
{
INT_STRUCT_STAT st;
@@ -1652,7 +1665,9 @@ ssize_t lsetxattr(const char *path, const char *name, void *value, size_t size,
return common_setxattr(&st, name, value, size, flags);
}
+#endif /* HAVE_LSETXATTR */
+#ifdef HAVE_FSETXATTR
ssize_t fsetxattr(int fd, const char *name, void *value, size_t size, int flags)
{
INT_STRUCT_STAT st;
@@ -1671,7 +1686,9 @@ ssize_t fsetxattr(int fd, const char *name, void *value, size_t size, int flags)
return common_setxattr(&st, name, value, size, flags);
}
+#endif /* HAVE_FSETXATTR */
+#ifdef HAVE_GETXATTR
ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
{
INT_STRUCT_STAT st;
@@ -1690,7 +1707,9 @@ ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
return common_getxattr(&st, name, value, size);
}
+#endif /* HAVE_GETXATTR */
+#ifdef HAVE_LGETXATTR
ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
{
INT_STRUCT_STAT st;
@@ -1709,7 +1728,9 @@ ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
return common_getxattr(&st, name, value, size);
}
+#endif /* HAVE_LGETXATTR */
+#ifdef HAVE_FGETXATTR
ssize_t fgetxattr(int fd, const char *name, void *value, size_t size)
{
INT_STRUCT_STAT st;
@@ -1728,7 +1749,9 @@ ssize_t fgetxattr(int fd, const char *name, void *value, size_t size)
return common_getxattr(&st, name, value, size);
}
+#endif /* HAVE_FGETXATTR */
+#ifdef HAVE_LISTXATTR
ssize_t listxattr(const char *path, char *list, size_t size)
{
INT_STRUCT_STAT st;
@@ -1747,7 +1770,9 @@ ssize_t listxattr(const char *path, char *list, size_t size)
return common_listxattr(&st, list, size);
}
+#endif /* HAVE_LISTXATTR */
+#ifdef HAVE_LLISTXATTR
ssize_t llistxattr(const char *path, char *list, size_t size)
{
INT_STRUCT_STAT st;
@@ -1766,7 +1791,9 @@ ssize_t llistxattr(const char *path, char *list, size_t size)
return common_listxattr(&st, list, size);
}
+#endif /* HAVE_LLISTXATTR */
+#ifdef HAVE_FLISTXATTR
ssize_t flistxattr(int fd, char *list, size_t size)
{
INT_STRUCT_STAT st;
@@ -1785,7 +1812,9 @@ ssize_t flistxattr(int fd, char *list, size_t size)
return common_listxattr(&st, list, size);
}
+#endif /* HAVE_FLISTXATTR */
+#ifdef HAVE_REMOVEXATTR
ssize_t removexattr(const char *path, const char *name)
{
INT_STRUCT_STAT st;
@@ -1804,7 +1833,9 @@ ssize_t removexattr(const char *path, const char *name)
return common_removexattr(&st, name);
}
+#endif /* HAVE_REMOVEXATTR */
+#ifdef HAVE_LREMOVEXATTR
ssize_t lremovexattr(const char *path, const char *name)
{
INT_STRUCT_STAT st;
@@ -1823,7 +1854,9 @@ ssize_t lremovexattr(const char *path, const char *name)
return common_removexattr(&st, name);
}
+#endif /* HAVE_LREMOVEXATTR */
+#ifdef HAVE_FREMOVEXATTR
ssize_t fremovexattr(int fd, const char *name)
{
INT_STRUCT_STAT st;
@@ -1842,6 +1875,7 @@ ssize_t fremovexattr(int fd, const char *name)
return common_removexattr(&st, name);
}
+#endif /* HAVE_FREMOVEXATTR */
#undef fakeroot_disabled
diff --git a/wrapfunc.inp b/wrapfunc.inp
index cda578a..fedb68e 100644
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -145,19 +145,45 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid)
#endif /* HAVE_SETFSGID */
initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group)
setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list)
+#ifdef HAVE_CAPSET
capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap)
+#endif /* HAVE_CAPSET */
+#ifdef HAVE_LISTXATTR
listxattr; ssize_t;(const char *path, char *list, size_t size);(path, list, size)
+#endif /* HAVE_LISTXATTR */
+#ifdef HAVE_LLISTXATTR
llistxattr; ssize_t;(const char *path, char *list, size_t size);(path, list, size)
+#endif /* HAVE_LLISTXATTR */
+#ifdef HAVE_FLISTXATTR
flistxattr; ssize_t;(int fd, char *list, size_t size);(fd, list, size)
+#endif /* HAVE_FLISTXATTR */
+#ifdef HAVE_GETXATTR
getxattr;ssize_t;(const char *path, const char *name, void *value, size_t size);(path, name, value, size)
+#endif /* HAVE_GETXATTR */
+#ifdef HAVE_LGETXATTR
lgetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size);(path, name, value, size)
+#endif /* HAVE_LGETXATTR */
+#ifdef HAVE_FGETXATTR
fgetxattr;ssize_t;(int fd, const char *name, void *value, size_t size);(fd, name, value, size)
+#endif /* HAVE_FGETXATTR */
+#ifdef HAVE_SETXATTR
setxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags)
+#endif /* HAVE_SETXATTR */
+#ifdef HAVE_LSETXATTR
lsetxattr;ssize_t;(const char *path, const char *name, void *value, size_t size, int flags);(path, name, value, size, flags)
+#endif /* HAVE_LSETXATTR */
+#ifdef HAVE_FSETXATTR
fsetxattr;ssize_t;(int fd, const char *name, void *value, size_t size, int flags);(fd, name, value, size, flags)
+#endif /* HAVE_FSETXATTR */
+#ifdef HAVE_REMOVEXATTR
removexattr;ssize_t;(const char *path, const char *name);(path, name)
+#endif /* HAVE_REMOVEXATTR */
+#ifdef HAVE_LREMOVEXATTR
lremovexattr;ssize_t;(const char *path, const char *name);(path, name)
+#endif /* HAVE_LREMOVEXATTR */
+#ifdef HAVE_FREMOVEXATTR
fremovexattr;ssize_t;(int fd, const char *name);(fd, name)
+#endif /* HAVE_FREMOVEXATTR */
#ifdef HAVE_FSTATAT
#ifdef HAVE_FCHMODAT
--
Debian packaging of fakeroot
More information about the Fakeroot-commits
mailing list