summaryrefslogtreecommitdiffstats
path: root/patches/fakeroot-1.29
diff options
context:
space:
mode:
authorChristian Melki <christian.melki@t2data.com>2022-09-23 16:21:10 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2022-09-23 16:32:41 +0200
commit00f974879df3416954431a3da4e5f157771263b7 (patch)
tree37a082d46c2a137bd8e59c1e7a3ad06cfdb4a7d2 /patches/fakeroot-1.29
parent3c5d76e7028c0decee45795adfcae054fbb1d703 (diff)
downloadptxdist-00f974879df3416954431a3da4e5f157771263b7.tar.gz
ptxdist-00f974879df3416954431a3da4e5f157771263b7.tar.xz
host-fakeroot: Version bump. 1.28 -> 1.29.
Minor bugfix. Hardly noteworthy. * Forward patches. Signed-off-by: Christian Melki <christian.melki@t2data.com> Message-Id: <20220923142110.1904332-1-christian.melki@t2data.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/fakeroot-1.29')
-rw-r--r--patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch71
-rw-r--r--patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch70
-rw-r--r--patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch33
l---------patches/fakeroot-1.29/autogen.sh1
-rw-r--r--patches/fakeroot-1.29/series6
5 files changed, 181 insertions, 0 deletions
diff --git a/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch b/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch
new file mode 100644
index 000000000..daff7f347
--- /dev/null
+++ b/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch
@@ -0,0 +1,71 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Wed, 11 May 2022 10:23:40 +0200
+Subject: [PATCH] Also wrap the "stat" library call
+
+Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Bug-Debian: https://bugs.debian.org/1001961
+
+Seems changes in glibc 2.33 caused the stat() function to be mapped
+into a stat() library call instead of __xstat() as it used to be.
+
+However, fakeroot does not wrap this, causing files to be reported
+with the real owner, not 0 as expected.
+
+The fix for this got a bit ugly as the abstraction in configure.ac
+would not allow wrapping both "stat" and "__xstat". So enhance the
+search list capabilities with an optional symbol how the wrapped
+function is named internally. Also hack the parser so "stat" gets
+actually probed and not mistaken for __xstat.
+
+Using "realstat" as a symbol is not the best choice as it might be
+confusing, but "statstat" seemed even worse.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ configure.ac | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e7c1c7c484f3..3fa4756557af 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -362,9 +362,13 @@ dnl Digital Unix: stat
+
+ :>fakerootconfig.h.tmp
+
+-for SEARCH in %stat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do
+- FUNC=`echo $SEARCH|sed -e 's/.*%//'`
++for SEARCH in %stat s%tat@realstat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do
++ FUNC=`echo $SEARCH|sed -e 's/.*%// ; s/@.*//'`
+ PRE=`echo $SEARCH|sed -e 's/%.*//'`
++ SYMBOL=`echo $SEARCH|sed -e 's/.*@//'`
++ if test "$SYMBOL" = "$SEARCH" ; then
++ SYMBOL="${PRE}${FUNC}"
++ fi
+ FOUND=
+ for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do
+ AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED)
+@@ -375,8 +379,8 @@ dnl
+ dnl for WRAPPED in _${PRE}${FUNC}; do
+ dnl FOUND=$WRAPPED
+ if test -n "$FOUND"; then
+- PF=[`echo ${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`]
+- DEFINE_WRAP=[`echo wrap_${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`]
++ PF=[`echo $SYMBOL | tr '[a-z]' '[A-Z]'`]
++ DEFINE_WRAP=[`echo wrap_${SYMBOL}| tr '[a-z]' '[A-Z]'`]
+ DEFINE_NEXT=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`]
+ DEFINE_ARG=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`]
+ AC_DEFINE_UNQUOTED(WRAP_${PF}, $FOUND)
+@@ -518,6 +522,12 @@ AH_VERBATIM([WRAP_STAT],
+ #define TMP_STAT __astat
+ #define NEXT_STAT_NOARG next___astat
+
++#define WRAP_REALSTAT __astat
++#define WRAP_REALSTAT_QUOTE __astat
++#define WRAP_REALSTAT_RAW __astat
++#define TMP_REALSTAT __astat
++#define NEXT_REALSTAT_NOARG next___astat
++
+ #define WRAP_LSTAT_QUOTE __astat
+ #define WRAP_LSTAT __astat
+ #define WRAP_LSTAT_RAW __astat
diff --git a/patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch b/patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch
new file mode 100644
index 000000000..3e091379d
--- /dev/null
+++ b/patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch
@@ -0,0 +1,70 @@
+From: Christian Melki <christian.melki@t2data.com>
+Date: Wed, 11 May 2022 10:25:59 +0200
+Subject: [PATCH] Fix prototype generation for openat
+
+Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Bug-Debian: https://bugs.debian.org/995393
+
+As jrtc27 pointed out in IRC, ppc64el is more strict than other
+architectures when it comes to va_arg handling:
+
+ it's that ppc64le uses the elfv2 abi, and for variadic calls you
+ must reserve space for a parameter save area
+
+So enhance wrapawk to create a proper prototype and argument
+handling although it's specific to the openat call. Also add the
+missing documentation for the sixth column to wrapfunc.inp.
+
+Signed-off-by: Christian Melki <christian.melki@t2data.com>
+---
+ wrapawk | 20 +++++++++++++++++++-
+ wrapfunc.inp | 4 +++-
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/wrapawk b/wrapawk
+index a2fd220a6fcb..9b2c285c257b 100644
+--- a/wrapawk
++++ b/wrapawk
+@@ -37,7 +37,25 @@ BEGIN{
+ argtype=$3;
+ argname=$4;
+ MACRO=$5;
+- if(MACRO){
++ openat_extra=$6;
++ if(openat_extra){
++ print " {(void(*))&next_" name ", \"" name "\"}," > structfile;
++ print "extern " ret " (*next_" name ")" openat_extra ";" > headerfile;
++ print ret " (*next_" name ")" openat_extra "=tmp_" name ";"> deffile;
++
++ print ret " tmp_" name, openat_extra "{" > tmpffile;
++ print " mode_t mode = 0;" > tmpffile;
++ print " if (flags & O_CREAT) {" > tmpffile;
++ print " va_list args;" > tmpffile;
++ print " va_start(args, flags);" > tmpffile;
++ print " mode = va_arg(args, int);" > tmpffile;
++ print " va_end(args);" > tmpffile;
++ print " }" > tmpffile;
++ print " load_library_symbols();" > tmpffile;
++ print " return next_" name, argname ";" > tmpffile;
++ print "}" > tmpffile;
++ print "" > tmpffile;
++ } else if(MACRO){
+ print " {(void(*))&NEXT_" MACRO "_NOARG, " name "_QUOTE}," > structfile;
+ print "extern " ret " (*NEXT_" MACRO "_NOARG)" argtype ";" > headerfile;
+ print ret " (*NEXT_" MACRO "_NOARG)" argtype "=TMP_" MACRO ";"> deffile;
+diff --git a/wrapfunc.inp b/wrapfunc.inp
+index 556af34579b0..f5bd4063152c 100644
+--- a/wrapfunc.inp
++++ b/wrapfunc.inp
+@@ -9,8 +9,10 @@
+ /**/ */
+ /* each line of this file lists 4 fields, seperated by a ";". */
+ /* The first field is the name of the wrapped function, then it's return */
+-/* value. After that come the function arguments with types, and the last */
++/* value. After that come the function arguments with types, and the fifth */
+ /* field contains the function arguments without types. */
++/* A sixth field is a special needed when wrapping the openat syscall. */
++/* Otherwise it's like the third (function arguments with types). */
+ /**/
+
+ /* __*xstat are used on glibc systems instead of just *xstat. */
diff --git a/patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch b/patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch
new file mode 100644
index 000000000..8d7a6994c
--- /dev/null
+++ b/patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch
@@ -0,0 +1,33 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 30 Oct 2011 22:16:53 +0100
+Subject: [PATCH] make fakeroot relocatable
+
+Calculate the libdir relative to the fakeroot binary.
+
+Not for upstream.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ scripts/fakeroot.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/fakeroot.in b/scripts/fakeroot.in
+index 0d6f435af1ed..08d8b27863a8 100755
+--- a/scripts/fakeroot.in
++++ b/scripts/fakeroot.in
+@@ -30,12 +30,12 @@ fatal ()
+ }
+
+ # strip /bin/fakeroot to find install prefix
+-FAKEROOT_PREFIX=@prefix@
+-FAKEROOT_BINDIR=@bindir@
++FAKEROOT_BINDIR="`dirname "$0"`"
++FAKEROOT_PREFIX="`dirname "$FAKEROOT_BINDIR"`"
+
+ USEABSLIBPATH=@LDPRELOADABS@
+ FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
+-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
++PATHS="${FAKEROOT_PREFIX}@libdir@":${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
+ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+
+ FAKED_MODE="unknown-is-root"
diff --git a/patches/fakeroot-1.29/autogen.sh b/patches/fakeroot-1.29/autogen.sh
new file mode 120000
index 000000000..9f8a4cb7d
--- /dev/null
+++ b/patches/fakeroot-1.29/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh \ No newline at end of file
diff --git a/patches/fakeroot-1.29/series b/patches/fakeroot-1.29/series
new file mode 100644
index 000000000..7cc751cd4
--- /dev/null
+++ b/patches/fakeroot-1.29/series
@@ -0,0 +1,6 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Also-wrap-the-stat-library-call.patch
+0002-Fix-prototype-generation-for-openat.patch
+0003-make-fakeroot-relocatable.patch
+# a15acfb9f130741fa53186998a6f6ee3 - git-ptx-patches magic