* update fakeroot to 1.36-1.1

This commit is contained in:
Alexander Baldeck 2024-09-12 19:52:29 +02:00
parent ea8f658126
commit c54abf0f14
7 changed files with 63 additions and 204 deletions

View File

@ -1,12 +1,13 @@
pkgbase = fakeroot
pkgdesc = Tool for simulating superuser privileges
pkgver = 1.35
pkgver = 1.36
pkgrel = 1
url = https://tracker.debian.org/pkg/fakeroot
install = fakeroot.install
arch = x86_64
license = GPL
license = GPL-3.0-or-later
checkdepends = sharutils
makedepends = git
makedepends = systemd
makedepends = po4a
depends = glibc
@ -14,7 +15,7 @@ pkgbase = fakeroot
depends = sed
depends = util-linux
depends = sh
source = https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.35.orig.tar.gz
sha256sums = e5a427b4ab1eb4a2158b3312547a4155aede58735cd5c2910421988834b440a4
source = git+https://salsa.debian.org/clint/fakeroot.git#tag=upstream/1.36
sha256sums = 6cf5ddf3fdb4d2ece465e4dc51b4d0b1a265c241bdaf2858f0a1519a9b4e8c63
pkgname = fakeroot

View File

@ -0,0 +1,36 @@
From 2660e24756d2b89064b8879e4a376a2063c546e7 Mon Sep 17 00:00:00 2001
From: Clint Adams <clint@debian.org>
Date: Sun, 11 Aug 2024 17:35:58 -0400
Subject: Cast uint8_t pointers. closes: #1074365.
---
communicate.c | 2 +-
faked.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/communicate.c b/communicate.c
index 56eba7a..580ce63 100644
--- a/communicate.c
+++ b/communicate.c
@@ -576,7 +576,7 @@ void send_get_fakem(struct fake_msg *buf)
&fm,
sizeof(fm)-sizeof(fm.mtype),0,0);
- ptr = &fm;
+ ptr = (uint8_t *)&fm;
for (k=0; k<16; k++) {
magic_candidate = *(uint32_t*)&ptr[k];
if (magic_candidate == FAKEROOT_MAGIC_LE || magic_candidate == FAKEROOT_MAGIC_BE) {
diff --git a/faked.c b/faked.c
index 6212a58..d6e1b50 100644
--- a/faked.c
+++ b/faked.c
@@ -1089,7 +1089,7 @@ void get_msg()
do {
r=msgrcv(msg_get,&fm,sizeof(struct fake_msg_buf),0,0);
- ptr = &fm;
+ ptr = (uint8_t *)&fm;
for (k=0; k<16; k++) {
magic_candidate = *(uint32_t*)&ptr[k];
if (magic_candidate == FAKEROOT_MAGIC_LE || magic_candidate == FAKEROOT_MAGIC_BE) {

View File

@ -5,26 +5,32 @@
pkgname=fakeroot
pkgver=1.36
pkgrel=1
pkgrel=1.1
pkgdesc='Tool for simulating superuser privileges'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('GPL')
license=('GPL-3.0-or-later')
url='https://tracker.debian.org/pkg/fakeroot'
install=fakeroot.install
depends=('glibc' 'filesystem' 'sed' 'util-linux' 'sh')
makedepends=('systemd' 'po4a')
makedepends=('git' 'systemd' 'po4a')
checkdepends=('sharutils')
source=("https://deb.debian.org/debian/pool/main/f/$pkgname/${pkgname}_${pkgver}.orig.tar.gz")
sha256sums=('7fe3cf3daf95ee93b47e568e85f4d341a1f9ae91766b4f9a9cdc29737dea4988')
source=("git+https://salsa.debian.org/clint/fakeroot.git#tag=upstream/${pkgver}")
sha256sums=('6cf5ddf3fdb4d2ece465e4dc51b4d0b1a265c241bdaf2858f0a1519a9b4e8c63')
prepare() {
cd "${pkgname}"
autoreconf -fi
}
build() {
cd $pkgname-$pkgver
cd "${pkgname}"
./configure --prefix=/usr \
./configure \
--prefix=/usr \
--libdir=/usr/lib/libfakeroot \
--disable-static \
--with-ipc=sysv
make
cd doc
@ -32,17 +38,19 @@ build() {
}
check() {
cd $pkgname-$pkgver
cd "${pkgname}"
make check
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
cd "${pkgname}"
install -dm0755 "$pkgdir/usr/lib/ld.so.conf.d/"
echo '/usr/lib/libfakeroot' > "$pkgdir/usr/lib/ld.so.conf.d/fakeroot.conf"
make DESTDIR="${pkgdir}" install
install -dm0755 "${pkgdir}/usr/lib/ld.so.conf.d/"
echo '/usr/lib/libfakeroot' > "${pkgdir}/usr/lib/ld.so.conf.d/fakeroot.conf"
# install README for sysv/tcp usage
install -Dm0644 README "$pkgdir/usr/share/doc/$pkgname/README"
install -Dm0644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
}

View File

@ -1,37 +0,0 @@
From 03bc0ee07fb6e293d081ffd8af1654788b434f6a Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Thu, 11 Feb 2021 20:59:25 -0800
Subject: [PATCH] libfakeroot.c: define _STAT_VER if not already defined
Based on patch from Jan Pazdziora:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SMQ3RYXEYTVZH6PLQMKNB3NM4XLPMNZO/
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
libfakeroot.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libfakeroot.c b/libfakeroot.c
index 3e80e38..14cdbc4 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -90,6 +90,16 @@
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
#endif
+#ifndef _STAT_VER
+ #if defined (__aarch64__)
+ #define _STAT_VER 0
+ #elif defined (__x86_64__)
+ #define _STAT_VER 1
+ #else
+ #define _STAT_VER 3
+ #endif
+#endif
+
/*
These INT_* (which stands for internal) macros should always be used when
the fakeroot library owns the storage of the stat variable.
--
GitLab

View File

@ -1,72 +0,0 @@
From feda578ca3608b7fc9a28a3a91293611c0ef47b7 Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Thu, 11 Feb 2021 21:00:04 -0800
Subject: [PATCH] libfakeroot.c: add wrappers for new glibc 2.33+ symbols
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
libfakeroot.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/libfakeroot.c b/libfakeroot.c
index 14cdbc4..d75c51f 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1352,6 +1352,54 @@ int renameat(int olddir_fd, const char *oldpath,
#endif /* HAVE_FSTATAT */
+#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33)
+/* Glibc 2.33 exports symbols for these functions in the shared lib */
+ int lstat(const char *file_name, struct stat *statbuf) {
+ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf);
+ }
+ int stat(const char *file_name, struct stat *st) {
+ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st);
+ }
+ int fstat(int fd, struct stat *st) {
+ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st);
+ }
+
+ #ifdef HAVE_FSTATAT
+ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) {
+ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags);
+ }
+ #endif
+
+ #ifdef STAT64_SUPPORT
+ int lstat64(const char *file_name, struct stat64 *st) {
+ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st);
+ }
+ int stat64(const char *file_name, struct stat64 *st) {
+ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st);
+ }
+ int fstat64(int fd, struct stat64 *st) {
+ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st);
+ }
+
+ #ifdef HAVE_FSTATAT
+ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) {
+ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags);
+ }
+ #endif
+ #endif
+
+ int mknod(const char *pathname, mode_t mode, dev_t dev) {
+ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev);
+ }
+
+ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT)
+ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) {
+ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev);
+ }
+ #endif
+#endif /* GLIBC_PREREQ */
+
+
#ifdef FAKEROOT_FAKENET
pid_t fork(void)
{
--
GitLab

View File

@ -1,60 +0,0 @@
From c3eebec293e35b997bb46c22fb5a4e114afb5e7f Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Sat, 13 Feb 2021 19:32:08 -0800
Subject: [PATCH] configure.ac: fix __xmknod{,at} pointer argument
Switch default to assume * and not the absence of *.
On glibc 2.33+, there is no definition for these functions in header
files, so the compile test doesn't work. But, we can default to using
the pointer (as is the case with newer glibc), and use the header file
on older platforms to fail the test and use no pointer.
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
configure.ac | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 73415d2..d85566f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,13 +183,13 @@ AC_MSG_CHECKING([for type of arg of __xmknod])
]], [[
int __xmknod ( int ver,
const char *pathname ,
- mode_t mode , dev_t dev);
+ mode_t mode , dev_t *dev);
]])],[
- AC_DEFINE(XMKNOD_FRTH_ARG,)
- AC_MSG_RESULT([no extra *])
- ],[
AC_DEFINE(XMKNOD_FRTH_ARG,[*])
AC_MSG_RESULT([needs *])
+ ],[
+ AC_DEFINE(XMKNOD_FRTH_ARG,)
+ AC_MSG_RESULT([no extra *])
])
@@ -210,13 +210,13 @@ AC_MSG_CHECKING([for type of arg of __xmknodat])
int __xmknodat ( int ver,
int dirfd,
const char *pathname ,
- mode_t mode , dev_t dev);
+ mode_t mode , dev_t *dev);
]])],[
- AC_DEFINE(XMKNODAT_FIFTH_ARG,)
- AC_MSG_RESULT([no extra *])
- ],[
AC_DEFINE(XMKNODAT_FIFTH_ARG,[*])
AC_MSG_RESULT([needs *])
+ ],[
+ AC_DEFINE(XMKNODAT_FIFTH_ARG,)
+ AC_MSG_RESULT([no extra *])
])
--
GitLab

View File

@ -1,17 +0,0 @@
diff --git a/libfakeroot.c b/libfakeroot.c
index f867758..7ef6e47 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -256,10 +256,12 @@ void load_library_symbols(void){
/* clear dlerror() just in case dlsym() legitimately returns NULL */
msg = dlerror();
*(next_wrap[i].doit)=dlsym(get_libc(), next_wrap[i].name);
+#ifdef LIBFAKEROOT_DEBUGGING
if ( (msg = dlerror()) != NULL){
fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg);
/* abort ();*/
}
+#endif /* LIBFAKEROOT_DEBUGGING */
}
}