Contrl: tag -1 + patch

On Sun, Aug 17, 2014 at 10:56:49AM +0200, Aurelien Jarno wrote:
> Package: fakeroot
> Version: 1.20-1.1
> Severity: serious
> Justification: fails to build from source (but built successfully in the past)
> 
> fakeroot fails to build from source in a recent sid chroot. From my
> pbuilder log:
> 
> | Making all in test
> | make[3]: Entering directory '/tmp/buildd/fakeroot-1.20.1/obj-sysv/test'
> | make[3]: Nothing to be done for 'all'.
> | make[3]: Leaving directory '/tmp/buildd/fakeroot-1.20.1/obj-sysv/test'
> | make[3]: Entering directory '/tmp/buildd/fakeroot-1.20.1/obj-sysv'
> | awk -f ../wrapawk < ../wrapfunc.inp
> | /bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. 
>     -W -Wall -g -O2 -MT libfakeroot.lo -MD -MP -MF .deps/libfakeroot.Tpo -c 
> -o libfakeroot.lo ../libfakeroot.c
> | libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -W -Wall -g -O2 -MT 
> libfakeroot.lo -MD -MP -MF .deps/libfakeroot.Tpo -c ../libfakeroot.c  -fPIC 
> -DPIC -o .libs/libfakeroot.o
> | ../libfakeroot.c:1646:9: error: conflicting types for 'setxattr'
> |  ssize_t setxattr(const char *path, const char *name, void *value, size_t 
> size, int flags)
> |          ^
> | In file included from /usr/include/sys/capability.h:30:0,
> |                  from ../libfakeroot.c:131:
> | /usr/include/x86_64-linux-gnu/sys/xattr.h:41:12: note: previous declaration 
> of 'setxattr' was here
> |  extern int setxattr (const char *__path, const char *__name,
> |             ^

xattr.h hasn't changed recently, that said recent versions of libcap-dev
(providing capability.h) now includes it. That's why the conflicts
appeared suddenly. That said the problem is real and the function
definitions seems to have been wrong for a lot of time in fakeroot. The
patch below fixes that by using the same definitions than in xattr.h.


--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1570,7 +1570,7 @@
 #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)
+static int common_setxattr(INT_STRUCT_STAT *st, const char *name, const void * 
value, size_t size, int flags)
 {
   xattr_args xattr;
   xattr.name = name;
@@ -1625,7 +1625,7 @@
 #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)
+static int common_removexattr(INT_STRUCT_STAT *st, const char *name)
 {
   xattr_args xattr;
   xattr.name = name;
@@ -1643,7 +1643,7 @@
 #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 setxattr(const char *path, const char *name, const void *value, size_t 
size, int flags)
 {
   INT_STRUCT_STAT st;
   int r;
@@ -1664,7 +1664,7 @@
 #endif /* HAVE_SETXATTR */
 
 #ifdef HAVE_LSETXATTR
-ssize_t lsetxattr(const char *path, const char *name, void *value, size_t 
size, int flags)
+int lsetxattr(const char *path, const char *name, const void *value, size_t 
size, int flags)
 {
   INT_STRUCT_STAT st;
   int r;
@@ -1685,7 +1685,7 @@
 #endif /* HAVE_LSETXATTR */
 
 #ifdef HAVE_FSETXATTR
-ssize_t fsetxattr(int fd, const char *name, void *value, size_t size, int 
flags)
+int fsetxattr(int fd, const char *name, const void *value, size_t size, int 
flags)
 {
   INT_STRUCT_STAT st;
   int r;
@@ -1832,7 +1832,7 @@
 #endif /* HAVE_FLISTXATTR */
 
 #ifdef HAVE_REMOVEXATTR
-ssize_t removexattr(const char *path, const char *name)
+int removexattr(const char *path, const char *name)
 {
   INT_STRUCT_STAT st;
   int r;
@@ -1853,7 +1853,7 @@
 #endif /* HAVE_REMOVEXATTR */
 
 #ifdef HAVE_LREMOVEXATTR
-ssize_t lremovexattr(const char *path, const char *name)
+int lremovexattr(const char *path, const char *name)
 {
   INT_STRUCT_STAT st;
   int r;
@@ -1874,7 +1874,7 @@
 #endif /* HAVE_LREMOVEXATTR */
 
 #ifdef HAVE_FREMOVEXATTR
-ssize_t fremovexattr(int fd, const char *name)
+int fremovexattr(int fd, const char *name)
 {
   INT_STRUCT_STAT st;
   int r;
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -168,22 +168,22 @@
 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)
+setxattr;int;(const char *path, const char *name, const 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)
+lsetxattr;int;(const char *path, const char *name, const 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)
+fsetxattr;int;(int fd, const char *name, const 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)
+removexattr;int;(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)
+lremovexattr;int;(const char *path, const char *name);(path, name)
 #endif /* HAVE_LREMOVEXATTR */
 #ifdef HAVE_FREMOVEXATTR
-fremovexattr;ssize_t;(int fd, const char *name);(fd, name)
+fremovexattr;int;(int fd, const char *name);(fd, name)
 #endif /* HAVE_FREMOVEXATTR */
 
 #ifdef HAVE_FSTATAT

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to