SHA256
1
0
forked from pool/fakeroot

Accepting request 970077 from devel:tools

OBS-URL: https://build.opensuse.org/request/show/970077
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fakeroot?expand=0&rev=11
This commit is contained in:
Dominique Leuenberger 2022-04-14 15:25:38 +00:00 committed by Git OBS Bridge
commit 1c8a78d112
10 changed files with 95 additions and 333 deletions

View File

@ -1,250 +0,0 @@
From f91abea8f685776a29d40382a35301f6980c953b Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <christophe@krop.fr>
Date: Wed, 17 Mar 2021 15:53:12 +0100
Subject: [PATCH] glibc 2.33 compatibility fixes
Source: https://salsa.debian.org/clint/fakeroot/-/merge_requests/10
---
configure.ac | 17 +++++------
libfakeroot.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++--
wrapawk_macosx | 10 +++++--
wrapfunc.inp | 4 +--
4 files changed, 94 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index 73415d2..35f9ecf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,7 @@ for first in size_t int; do
#include <sys/types.h>
#endif
#include <unistd.h>
+#include <stdio.h>
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
@@ -183,13 +184,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 +211,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 *])
])
diff --git a/libfakeroot.c b/libfakeroot.c
index 7f13286..c7014aa 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.
@@ -112,8 +122,16 @@
#define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER)
#define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
#define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b)
+
+/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
+ id_t is used everywhere, just happens to be int on some OSes */
+#ifndef _ID_T
+#define _ID_T
+typedef int id_t;
+#endif
#endif
+#include <sys/types.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
@@ -125,7 +143,6 @@
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
-#include <sys/types.h>
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif /* HAVE_SYS_ACL_H */
@@ -188,6 +205,15 @@ extern int unsetenv (const char *name);
#undef __lxstat64
#undef _FILE_OFFSET_BITS
+
+#ifndef AT_EMPTY_PATH
+#define AT_EMPTY_PATH 0
+#endif
+
+#ifndef AT_NO_AUTOMOUNT
+#define AT_NO_AUTOMOUNT 0
+#endif
+
/*
// next_wrap_st:
// this structure is used in next_wrap, which is defined in
@@ -1342,6 +1368,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)
{
@@ -1911,7 +1985,7 @@ ssize_t fremovexattr(int fd, const char *name)
}
#endif /* HAVE_FREMOVEXATTR */
-int setpriority(int which, int who, int prio){
+int setpriority(int which, id_t who, int prio){
if (fakeroot_disabled)
return next_setpriority(which, who, prio);
next_setpriority(which, who, prio);
diff --git a/wrapawk_macosx b/wrapawk_macosx
index 088a7f4..f783219 100644
--- a/wrapawk_macosx
+++ b/wrapawk_macosx
@@ -46,26 +46,30 @@ BEGIN{
argtype=$3;
argname=$4;
MACRO=$5;
+ argtype_def=$6
+ if(!argtype_def) {
+ argtype_def = argtype
+ }
if(MACRO){
print "extern " ret " MY_DEF(" name ")" argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
print "INTERPOSE(MY_DEF(" name "_RAW)," name "_RAW);" > structfile;
print "#undef " name > deffile
print "#define " name " MY_DEF(" name "_RAW)" > deffile
- print "extern " ret, name, argtype ";" > tmpffile;
+ print "extern " ret, name, argtype_def ";" > tmpffile;
print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " __attribute__((always_inline));" > tmpffile;
print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " {" > tmpffile;
print " return " name, argname ";" > tmpffile;
print "}" > tmpffile;
print "" > tmpffile;
} else {
- print "extern " ret " my_" name, argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
+ print "extern " ret " my_" name, argtype_def " __attribute__((visibility(\"hidden\")));" > headerfile;
print "#undef " name > structfile;
print "INTERPOSE(my_" name "," name ");" > structfile;
print "#define " name " my_" name > structfile
print "#define " name " my_" name > deffile
- print "extern " ret, name, argtype ";" > tmpffile;
+ print "extern " ret, name, argtype_def ";" > tmpffile;
if(argname){
print "static __inline__ " ret " next_" name, argtype " __attribute__((always_inline));" > tmpffile;
print "static __inline__ " ret " next_" name, argtype " {" > tmpffile;
diff --git a/wrapfunc.inp b/wrapfunc.inp
index f7ad186..556af34 100644
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid)
initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group)
getgroups;int;(int size, gid_t list[]);(size, list)
setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list)
-setpriority;int;(int which, int who, int prio);(which, who, prio)
+setpriority;int;(int which, id_t who, int prio);(which, who, prio)
#ifdef HAVE_CAPSET
capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap)
#endif /* HAVE_CAPSET */
@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *path, uid_t owner, gid_t group, int flags)
mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode)
#endif /* HAVE_MKDIRAT */
#ifdef HAVE_OPENAT
-openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags)
+openat;int;(int dir_fd, const char *pathname, int flags, mode_t mode);(dir_fd, pathname, flags, mode);;(int dir_fd, const char *pathname, int flags, ...)
#endif /* HAVE_OPENAT */
#ifdef HAVE_RENAMEAT
renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath)
--
2.30.2

View File

@ -0,0 +1,63 @@
Subject: Also wrap the "stat" library call
Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Date: 2021-12-20
Bug-Debian: https://bugs.debian.org/1001961
Forwarded: Yes
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.
--- a/configure.ac
+++ b/configure.ac
@@ -353,9 +353,13 @@
:>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)
@@ -366,8 +370,8 @@
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)
@@ -509,6 +513,12 @@
#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

View File

@ -1,33 +0,0 @@
From: Adam Mizerski <adam@mizerski.pl>
Date: 2013-10-26 18:45:32 +0200
Subject: eglibc-fts-without-LFS
Upstream: no
Patch copied from debian.
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -1949,11 +1949,7 @@
|| r->fts_info == FTS_NS || r->fts_info == FTS_NSOK))
r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */
if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
-# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
-# else
SEND_GET_STAT(r->fts_statp, _STAT_VER);
-# endif
}
return r;
@@ -1972,11 +1968,7 @@
first=next_fts_children(ftsp, options);
for(r = first; r; r = r->fts_link) {
if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
-# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
-# else
SEND_GET_STAT(r->fts_statp, _STAT_VER);
-# endif
}
}

View File

@ -1,11 +0,0 @@
--- fakeroot-1.25.3/scripts/fakeroot.in.orig 2020-10-30 11:40:54.365410673 +0100
+++ fakeroot-1.25.3/scripts/fakeroot.in 2020-10-30 11:40:59.913425822 +0100
@@ -35,7 +35,7 @@
USEABSLIBPATH=@LDPRELOADABS@
FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
+PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib/libfakeroot
FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
FAKED_MODE="unknown-is-root"

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e903683357f7f5bcc31b879fd743391ad47691d4be33d24a76be3b6c21e956c
size 126884

View File

@ -1,12 +0,0 @@
Index: fakeroot-1.24/test/Makefile.am
===================================================================
--- fakeroot-1.24.orig/test/Makefile.am
+++ fakeroot-1.24/test/Makefile.am
@@ -9,7 +9,6 @@ TESTS = \
t.no_ld_preload \
t.no_ld_preload_link \
t.option \
- t.tar \
t.touchinstall \
t.truereturn \
t.xattr

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Fri Mar 25 18:03:42 UTC 2022 - Sarah Kriesch <sarah.kriesch@opensuse.org>
- Update to 1.28
* Revert commit "Use fixed-width members in fake_msg"
* Annotate sharutils dependency <!nocheck>. (Closes: #982188)
* Wrap the "stat" library call. Closes: #1001961
* Work around segfault on ppc64el. Closes: #995393
* Includes patch from lemonsqueeze to improve fakeroot-tcp
performance by setting TCP_NODELAY. closes: #1003596.
* Includes patch from Samuel Thibault to handle _STAT_VER on
GNU/Hurd. closes: #1006151.
* autoconf 2.71 required
* Add also-wrap-stat-library-call.patch (deb#1001961)
* Remove fakeroot-1.20-eglibc-fts-without-LFS.patch
* Remove fakeroot-drop-tartest.patch
* Remove 0001-glibc-2.33-compatibility-fixes.patch
* Remove fakeroot-1.20-lib32.patch
* Remove stat-ver-riscv.patch
-------------------------------------------------------------------
Sun May 16 21:18:43 UTC 2021 - Andreas Schwab <schwab@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package fakeroot
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,25 +17,23 @@
Name: fakeroot
Version: 1.25.3
Version: 1.28
Release: 0
Summary: Wrapper that gives a fake root environment
License: GPL-3.0-or-later
Group: Development/Tools/Other
URL: http://fakeroot.alioth.debian.org/
Source0: http://ftp.debian.org/debian/pool/main/f/fakeroot/%{name}_%{version}.orig.tar.gz#/%{name}-%{version}.tar.gz
Source0: http://ftp.debian.org/debian/pool/main/f/fakeroot/%{name}_%{version}.orig.tar.gz#/%{name}_%{version}.orig.tar.gz
Source99: baselibs.conf
Patch0: %{name}-1.20-lib32.patch
Patch1: %{name}-1.20-eglibc-fts-without-LFS.patch
# PATCH-FIX-UPSTREAM fakeroot-1.21-fix-shell-in-fakeroot.patch (deb#828810)
Patch2: %{name}-1.21-fix-shell-in-fakeroot
Patch3: fakeroot-drop-tartest.patch
# PATCH-FIX-UPSTREAM
Patch4: 0001-glibc-2.33-compatibility-fixes.patch
Patch5: stat-ver-riscv.patch
Patch0: fakeroot-1.21-fix-shell-in-fakeroot
#PATCH-FIX-UPSTREAM also-wrap-stat-library-call.patch (deb#1001961)
Patch1: also-wrap-stat-library-call.patch
BuildRequires: automake
BuildRequires: fdupes
# user(daemon)/group(sys) is required for t.tar testsuite
BuildRequires: intltool
BuildRequires: autoconf
BuildRequires: libacl-devel
BuildRequires: libcap-devel
BuildRequires: libcap-progs
@ -58,7 +56,7 @@ had the user really been root.
%autosetup -p1
%build
autoreconf -fi
./bootstrap
pushd doc
po4a -k 0 --rm-backups --variable "srcdir=../doc/" po4a/po4a.cfg
popd

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56d405e36ff685f83879be08fdd654255ab9aa38632b4605a98e896ad63990c2
size 546234

View File

@ -1,13 +0,0 @@
Index: fakeroot-1.25.3/libfakeroot.c
===================================================================
--- fakeroot-1.25.3.orig/libfakeroot.c
+++ fakeroot-1.25.3/libfakeroot.c
@@ -91,7 +91,7 @@
#endif
#ifndef _STAT_VER
- #if defined (__aarch64__)
+ #if defined (__aarch64__) || defined (__riscv)
#define _STAT_VER 0
#elif defined (__x86_64__)
#define _STAT_VER 1