Compare commits
48 Commits
F-12-split
...
rawhide
Author | SHA1 | Date |
---|---|---|
Fedora Release Engineering | 6e0e21d9d5 | |
Sérgio M. Basto | 017a05b722 | |
Fedora Release Engineering | e554c3367a | |
Fedora Release Engineering | f489ebe692 | |
Sérgio M. Basto | df8b4ef619 | |
Fedora Release Engineering | f08dea8016 | |
Tom Stellard | f964d5d53d | |
Sérgio M. Basto | f3df07819b | |
Sérgio M. Basto | f98fb1cf75 | |
Fedora Release Engineering | 9e754fc81a | |
Fedora Release Engineering | 5aaba49fdb | |
Sérgio M. Basto | e0ef1b55a1 | |
Fedora Release Engineering | bcd645291c | |
Sérgio M. Basto | 74d5fe2869 | |
Sérgio M. Basto | c3b6445671 | |
Sérgio M. Basto | 2d9fabab76 | |
Sérgio M. Basto | a2d7b2bff9 | |
Fedora Release Engineering | 4843cac3b0 | |
Fedora Release Engineering | 4649736e20 | |
Fedora Release Engineering | 5254f5667f | |
Fedora Release Engineering | 80ac1b5855 | |
Igor Gnatenko | 3cad9d11fc | |
Fedora Release Engineering | dda5fa91b1 | |
Fedora Release Engineering | 82f1f26f56 | |
Sérgio M. Basto | ce10e2e8fb | |
Petr Písař | 6d88e98822 | |
Igor Gnatenko | b915f0b091 | |
Igor Gnatenko | 64c31bb96d | |
Dennis Gilmore | 7b90ebd606 | |
Dennis Gilmore | 2a5886e89b | |
Christopher Meng | 9aee50a333 | |
Peter Robinson | d2690ee6c2 | |
Dennis Gilmore | 3e026837e4 | |
Dennis Gilmore | 58ad4319cf | |
Ralf Corsépius | 8f1b202b47 | |
Dennis Gilmore | bd63d48587 | |
Dennis Gilmore | 974480d665 | |
Dennis Gilmore | 86899dd38b | |
Dennis Gilmore | 84691eaa9d | |
Axel Thimm | 2596f6a75e | |
Axel Thimm | f2c58df5c6 | |
Fedora Release Engineering | eb2d8c7352 | |
Fedora Release Engineering | ad0d6a438c | |
Fedora Release Engineering | b60f23e1b6 | |
Jesse Keating | 9bc9e993cf | |
Bill Nottingham | b6afc887c9 | |
Bill Nottingham | 7909909d1a | |
Jesse Keating | 7e05477832 |
|
@ -1 +0,0 @@
|
|||
fakechroot_2.9.orig.tar.gz
|
|
@ -0,0 +1,5 @@
|
|||
fakechroot_2.9.orig.tar.gz
|
||||
/fakechroot-2.17.2.tar.gz
|
||||
/fakechroot-2.18.tar.gz
|
||||
/fakechroot-2.19.tar.gz
|
||||
/fakechroot-2.20.1.tar.gz
|
|
@ -0,0 +1,23 @@
|
|||
From 534e6d555736b97211523970d378dfb0db2608e9 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
Date: Mon, 22 Feb 2021 21:44:07 -0800
|
||||
Subject: [PATCH] tmpnam.c: fix heap overflow
|
||||
|
||||
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
---
|
||||
src/tmpnam.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/tmpnam.c b/src/tmpnam.c
|
||||
index ce60817..917ee6b 100644
|
||||
--- a/src/tmpnam.c
|
||||
+++ b/src/tmpnam.c
|
||||
@@ -42,7 +42,7 @@ wrapper(tmpnam, char *, (char * s))
|
||||
|
||||
expand_chroot_path(ptr);
|
||||
|
||||
- ptr2 = malloc(strlen(ptr));
|
||||
+ ptr2 = malloc(strlen(ptr) + 1);
|
||||
if (ptr2 == NULL) return NULL;
|
||||
|
||||
strcpy(ptr2, ptr);
|
|
@ -0,0 +1,213 @@
|
|||
From 693a3597ea7fccfb62f357503ff177bd3e3d5a89 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
Date: Mon, 22 Feb 2021 21:47:09 -0800
|
||||
Subject: [PATCH] fix glibc 2.33+ compatibility
|
||||
|
||||
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
---
|
||||
configure.ac | 20 ++++++++++++++++++++
|
||||
src/ftw.c | 2 +-
|
||||
src/ftw64.c | 14 +++++++++++---
|
||||
src/libfakechroot.h | 15 +++++++++++++++
|
||||
src/lstat.c | 2 +-
|
||||
src/lstat.h | 2 +-
|
||||
src/lstat64.c | 2 +-
|
||||
src/mknod.c | 2 +-
|
||||
src/mknodat.c | 2 +-
|
||||
src/stat.c | 2 +-
|
||||
src/stat64.c | 2 +-
|
||||
11 files changed, 54 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f8cdb32..9cc2e77 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -75,6 +75,26 @@ ACX_CHECK_C_ATTRIBUTE_VISIBILITY
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([dl], [dlsym])
|
||||
|
||||
+AH_TEMPLATE([NEW_GLIBC], [glibc >= 2.33])
|
||||
+AC_MSG_CHECKING([for glibc 2.33+])
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
+ #include <sys/stat.h>
|
||||
+ ]], [[
|
||||
+#ifdef __GLIBC__
|
||||
+#if !__GLIBC_PREREQ(2,33)
|
||||
+#error glibc<2.33
|
||||
+#endif
|
||||
+#else
|
||||
+#error not glibc
|
||||
+#endif
|
||||
+ ]])],[
|
||||
+ AC_DEFINE(NEW_GLIBC,1)
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ ],[
|
||||
+ AC_DEFINE(NEW_GLIBC,0)
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ ])
|
||||
+
|
||||
# Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
diff --git a/src/ftw.c b/src/ftw.c
|
||||
index 92fc126..a9abc85 100644
|
||||
--- a/src/ftw.c
|
||||
+++ b/src/ftw.c
|
||||
@@ -185,7 +185,7 @@ int rpl_lstat (const char *, struct stat *);
|
||||
# define NFTW_NEW_NAME __new_nftw
|
||||
# define INO_T ino_t
|
||||
# define STAT stat
|
||||
-# ifdef _LIBC
|
||||
+# if defined(_LIBC) && !NEW_GLIBC
|
||||
# define LXSTAT __lxstat
|
||||
# define XSTAT __xstat
|
||||
# define FXSTATAT __fxstatat
|
||||
diff --git a/src/ftw64.c b/src/ftw64.c
|
||||
index 7cc8cdf..cee1f2b 100644
|
||||
--- a/src/ftw64.c
|
||||
+++ b/src/ftw64.c
|
||||
@@ -18,6 +18,8 @@
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
+#include "config.h"
|
||||
+
|
||||
#define __FTW64_C
|
||||
#define FTW_NAME ftw64
|
||||
#define NFTW_NAME nftw64
|
||||
@@ -25,9 +27,15 @@
|
||||
#define NFTW_NEW_NAME __new_nftw64
|
||||
#define INO_T ino64_t
|
||||
#define STAT stat64
|
||||
-#define LXSTAT __lxstat64
|
||||
-#define XSTAT __xstat64
|
||||
-#define FXSTATAT __fxstatat64
|
||||
+#if NEW_GLIBC
|
||||
+# define LXSTAT(V,f,sb) lstat64 (f,sb)
|
||||
+# define XSTAT(V,f,sb) stat64 (f,sb)
|
||||
+# define FXSTATAT(V,d,f,sb,m) fstatat64 (d, f, sb, m)
|
||||
+#else
|
||||
+# define LXSTAT __lxstat64
|
||||
+# define XSTAT __xstat64
|
||||
+# define FXSTATAT __fxstatat64
|
||||
+#endif
|
||||
#define FTW_FUNC_T __ftw64_func_t
|
||||
#define NFTW_FUNC_T __nftw64_func_t
|
||||
|
||||
diff --git a/src/libfakechroot.h b/src/libfakechroot.h
|
||||
index 4cf199f..64ff15f 100644
|
||||
--- a/src/libfakechroot.h
|
||||
+++ b/src/libfakechroot.h
|
||||
@@ -200,6 +200,21 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+#ifndef _STAT_VER
|
||||
+ #if defined (__aarch64__)
|
||||
+ #define _STAT_VER 0
|
||||
+ #elif defined (__powerpc__) && __WORDSIZE == 64
|
||||
+ #define _STAT_VER 1
|
||||
+ #elif defined (__riscv) && __riscv_xlen==64
|
||||
+ #define _STAT_VER 0
|
||||
+ #elif defined (__s390x__)
|
||||
+ #define _STAT_VER 1
|
||||
+ #elif defined (__x86_64__)
|
||||
+ #define _STAT_VER 1
|
||||
+ #else
|
||||
+ #define _STAT_VER 3
|
||||
+ #endif
|
||||
+#endif
|
||||
|
||||
typedef void (*fakechroot_wrapperfn_t)(void);
|
||||
|
||||
diff --git a/src/lstat.c b/src/lstat.c
|
||||
index 54e3263..fa38323 100644
|
||||
--- a/src/lstat.c
|
||||
+++ b/src/lstat.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#ifndef HAVE___LXSTAT
|
||||
+#if !defined(HAVE___LXSTAT) || NEW_GLIBC
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
diff --git a/src/lstat.h b/src/lstat.h
|
||||
index ee48303..c46a2b9 100644
|
||||
--- a/src/lstat.h
|
||||
+++ b/src/lstat.h
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <config.h>
|
||||
#include "libfakechroot.h"
|
||||
|
||||
-#ifndef HAVE___LXSTAT
|
||||
+#if !defined(HAVE___LXSTAT) || NEW_GLIBC
|
||||
|
||||
wrapper_proto(lstat, int, (const char *, struct stat *));
|
||||
|
||||
diff --git a/src/lstat64.c b/src/lstat64.c
|
||||
index b6212fc..a332d7c 100644
|
||||
--- a/src/lstat64.c
|
||||
+++ b/src/lstat64.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#if defined(HAVE_LSTAT64) && !defined(HAVE___LXSTAT64)
|
||||
+#if defined(HAVE_LSTAT64) && (!defined(HAVE___LXSTAT64) || NEW_GLIBC)
|
||||
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#define _BSD_SOURCE
|
||||
diff --git a/src/mknod.c b/src/mknod.c
|
||||
index 2771037..aeb750b 100644
|
||||
--- a/src/mknod.c
|
||||
+++ b/src/mknod.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#ifndef HAVE___XMKNOD
|
||||
+#if !defined(HAVE___XMKNOD) || NEW_GLIBC
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "libfakechroot.h"
|
||||
diff --git a/src/mknodat.c b/src/mknodat.c
|
||||
index 732a22b..3239b35 100644
|
||||
--- a/src/mknodat.c
|
||||
+++ b/src/mknodat.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#if defined(HAVE_MKNODAT) && !defined(HAVE___XMKNODAT)
|
||||
+#if defined(HAVE_MKNODAT) && (!defined(HAVE___XMKNODAT) || NEW_GLIBC)
|
||||
|
||||
#define _ATFILE_SOURCE
|
||||
#include <sys/stat.h>
|
||||
diff --git a/src/stat.c b/src/stat.c
|
||||
index 7b37793..5ef57ba 100644
|
||||
--- a/src/stat.c
|
||||
+++ b/src/stat.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#ifndef HAVE___XSTAT
|
||||
+#if !defined(HAVE___XSTAT) || NEW_GLIBC
|
||||
|
||||
#define _BSD_SOURCE
|
||||
#define _DEFAULT_SOURCE
|
||||
diff --git a/src/stat64.c b/src/stat64.c
|
||||
index a360f66..993ce80 100644
|
||||
--- a/src/stat64.c
|
||||
+++ b/src/stat64.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
-#if defined(HAVE_STAT64) && !defined(HAVE___XSTAT64)
|
||||
+#if defined(HAVE_STAT64) && (!defined(HAVE___XSTAT64) || NEW_GLIBC)
|
||||
|
||||
#define _BSD_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
|
@ -0,0 +1,93 @@
|
|||
From 75d7e6fa191c11a791faff06a0de86eaa7801d05 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
Date: Mon, 22 Feb 2021 21:46:36 -0800
|
||||
Subject: [PATCH] declare missing bufs, remove ver from lstat
|
||||
|
||||
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
||||
---
|
||||
src/lstat.c | 8 +++++---
|
||||
src/lstat.h | 2 +-
|
||||
src/mknod.c | 2 ++
|
||||
src/stat.c | 2 ++
|
||||
src/stat64.c | 2 ++
|
||||
5 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/lstat.c b/src/lstat.c
|
||||
index 3f6d819..54e3263 100644
|
||||
--- a/src/lstat.c
|
||||
+++ b/src/lstat.c
|
||||
@@ -28,9 +28,11 @@
|
||||
#include "lstat.h"
|
||||
|
||||
|
||||
-wrapper(lstat, int, (int ver, const char * filename, struct stat * buf))
|
||||
+wrapper(lstat, int, (const char * filename, struct stat * buf))
|
||||
{
|
||||
- debug("lstat(%d, \"%s\", &buf)", ver, filename);
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
+ debug("lstat(\"%s\", &buf)", filename);
|
||||
|
||||
if (!fakechroot_localdir(filename)) {
|
||||
if (filename != NULL) {
|
||||
@@ -40,7 +42,7 @@ wrapper(lstat, int, (int ver, const char * filename, struct stat * buf))
|
||||
}
|
||||
}
|
||||
|
||||
- return lstat_rel(ver, filename, buf);
|
||||
+ return lstat_rel(filename, buf);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/lstat.h b/src/lstat.h
|
||||
index 751c1ea..ee48303 100644
|
||||
--- a/src/lstat.h
|
||||
+++ b/src/lstat.h
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#ifndef HAVE___LXSTAT
|
||||
|
||||
-wrapper_proto(lstat, int, (int, const char *, struct stat *));
|
||||
+wrapper_proto(lstat, int, (const char *, struct stat *));
|
||||
|
||||
int lstat_rel(const char *, struct stat *);
|
||||
|
||||
diff --git a/src/mknod.c b/src/mknod.c
|
||||
index 52fd33b..2771037 100644
|
||||
--- a/src/mknod.c
|
||||
+++ b/src/mknod.c
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
wrapper(mknod, int, (const char * pathname, mode_t mode, dev_t dev))
|
||||
{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
debug("mknod(\"%s\", 0%o, %ld)", pathname, mode, dev);
|
||||
expand_chroot_path(pathname);
|
||||
return nextcall(mknod)(pathname, mode, dev);
|
||||
diff --git a/src/stat.c b/src/stat.c
|
||||
index 7845662..7b37793 100644
|
||||
--- a/src/stat.c
|
||||
+++ b/src/stat.c
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
wrapper(stat, int, (const char * file_name, struct stat * buf))
|
||||
{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
debug("stat(\"%s\", &buf)", file_name);
|
||||
expand_chroot_path(file_name);
|
||||
return nextcall(stat)(file_name, buf);
|
||||
diff --git a/src/stat64.c b/src/stat64.c
|
||||
index aac9c75..a360f66 100644
|
||||
--- a/src/stat64.c
|
||||
+++ b/src/stat64.c
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
wrapper(stat64, int, (const char * file_name, struct stat64 * buf))
|
||||
{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
debug("stat64(\"%s\", &buf)", file_name);
|
||||
expand_chroot_path(file_name);
|
||||
return nextcall(stat64)(file_name, buf);
|
|
@ -0,0 +1,137 @@
|
|||
From afd606ed43ca97a58db68e5add6e9a90f0a74c9b Mon Sep 17 00:00:00 2001
|
||||
From: neok-m4700 <neok-m4700@users.noreply.github.com>
|
||||
Date: Wed, 24 Feb 2021 17:36:57 +0100
|
||||
Subject: [PATCH] wrap fstatat and fstatat64
|
||||
|
||||
---
|
||||
configure.ac | 2 ++
|
||||
src/Makefile.am | 2 ++
|
||||
src/fstatat.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
src/fstatat64.c | 43 +++++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 89 insertions(+)
|
||||
create mode 100644 src/fstatat.c
|
||||
create mode 100644 src/fstatat64.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f8cdb32..032dd3d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -198,6 +198,8 @@ AC_CHECK_FUNCS(m4_normalize([
|
||||
freopen64
|
||||
fstat
|
||||
fstat64
|
||||
+ fstatat
|
||||
+ fstatat64
|
||||
fts_children
|
||||
fts_open
|
||||
fts_read
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 6066345..eb311c0 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -61,6 +61,8 @@ libfakechroot_la_SOURCES = \
|
||||
fopen64.c \
|
||||
freopen.c \
|
||||
freopen64.c \
|
||||
+ fstatat.c \
|
||||
+ fstatat64.c \
|
||||
fts.c \
|
||||
fts64.c \
|
||||
ftw.c \
|
||||
diff --git a/src/fstatat.c b/src/fstatat.c
|
||||
new file mode 100644
|
||||
index 0000000..ca7578b
|
||||
--- /dev/null
|
||||
+++ b/src/fstatat.c
|
||||
@@ -0,0 +1,42 @@
|
||||
+/*
|
||||
+ libfakechroot -- fake chroot environment
|
||||
+ Copyright (c) 2010, 2021 Piotr Roszatycki <dexter@debian.org>
|
||||
+
|
||||
+ This library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ This library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with this library; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+*/
|
||||
+
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_FSTATAT
|
||||
+
|
||||
+#define _ATFILE_SOURCE
|
||||
+#define _POSIX_C_SOURCE 200809L
|
||||
+#include <sys/stat.h>
|
||||
+#include <limits.h>
|
||||
+#include "libfakechroot.h"
|
||||
+
|
||||
+wrapper(fstatat, int, (int dirfd, const char *pathname, struct stat *buf, int flags))
|
||||
+{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
+ debug("fstatat(%d, \"%s\", &buf, %d)", dirfd, pathname, flags);
|
||||
+ expand_chroot_path_at(dirfd, pathname);
|
||||
+ return nextcall(fstatat)(dirfd, pathname, buf, flags);
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+typedef int empty_translation_unit;
|
||||
+#endif
|
||||
diff --git a/src/fstatat64.c b/src/fstatat64.c
|
||||
new file mode 100644
|
||||
index 0000000..1863372
|
||||
--- /dev/null
|
||||
+++ b/src/fstatat64.c
|
||||
@@ -0,0 +1,43 @@
|
||||
+/*
|
||||
+ libfakechroot -- fake chroot environment
|
||||
+ Copyright (c) 2010, 2021 Piotr Roszatycki <dexter@debian.org>
|
||||
+
|
||||
+ This library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ This library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with this library; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+*/
|
||||
+
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_FSTATAT64
|
||||
+
|
||||
+#define _ATFILE_SOURCE
|
||||
+#define _POSIX_C_SOURCE 200809L
|
||||
+#define _LARGEFILE64_SOURCE
|
||||
+#include <sys/stat.h>
|
||||
+#include <limits.h>
|
||||
+#include "libfakechroot.h"
|
||||
+
|
||||
+wrapper(fstatat64, int, (int dirfd, const char *pathname, struct stat64 *buf, int flags))
|
||||
+{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
+ debug("fstatat64(%d, \"%s\", &buf, %d)", dirfd, pathname, flags);
|
||||
+ expand_chroot_path_at(dirfd, pathname);
|
||||
+ return nextcall(fstatat64)(dirfd, pathname, buf, flags);
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+typedef int empty_translation_unit;
|
||||
+#endif
|
21
Makefile
21
Makefile
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: fakechroot
|
||||
# $Id$
|
||||
NAME := fakechroot
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
|
@ -0,0 +1,102 @@
|
|||
From b42d1fb9538f680af2f31e864c555414ccba842a Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Roszatycki <piotr.roszatycki@gmail.com>
|
||||
Date: Mon, 10 Feb 2020 13:59:10 -0800
|
||||
Subject: [PATCH] New `statx` function
|
||||
|
||||
---
|
||||
NEWS.md | 1 +
|
||||
configure.ac | 1 +
|
||||
src/Makefile.am | 1 +
|
||||
src/statx.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 47 insertions(+)
|
||||
create mode 100644 src/statx.c
|
||||
|
||||
diff --git a/NEWS.md b/NEWS.md
|
||||
index 9de12fe..f1210bf 100644
|
||||
--- a/NEWS.md
|
||||
+++ b/NEWS.md
|
||||
@@ -1,5 +1,10 @@
|
||||
# NEWS
|
||||
|
||||
+XX Xxx XXXX
|
||||
+
|
||||
+* UNRELEASED
|
||||
+* New `statx(2)` function was added: glibc supports it since 2.28.
|
||||
+
|
||||
## Version 2.20.1
|
||||
|
||||
22 Mar 2019
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a654edd..f8cdb32 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -277,6 +277,7 @@ AC_CHECK_FUNCS(m4_normalize([
|
||||
statfs64
|
||||
statvfs
|
||||
statvfs64
|
||||
+ statx
|
||||
stpcpy
|
||||
strchrnul
|
||||
strlcpy
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index d729b0e..6066345 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -152,6 +152,7 @@ libfakechroot_la_SOURCES = \
|
||||
statfs64.c \
|
||||
statvfs.c \
|
||||
statvfs64.c \
|
||||
+ statx.c \
|
||||
stpcpy.c \
|
||||
strchrnul.c \
|
||||
strchrnul.h \
|
||||
diff --git a/src/statx.c b/src/statx.c
|
||||
new file mode 100644
|
||||
index 0000000..524f73e
|
||||
--- /dev/null
|
||||
+++ b/src/statx.c
|
||||
@@ -0,0 +1,44 @@
|
||||
+/*
|
||||
+ libfakechroot -- fake chroot environment
|
||||
+ Copyright (c) 2010-2020 Piotr Roszatycki <dexter@debian.org>
|
||||
+
|
||||
+ This library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ This library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with this library; if not, write to the Free Software
|
||||
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+*/
|
||||
+
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_STATX
|
||||
+
|
||||
+#define _GNU_SOURCE
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+#include "libfakechroot.h"
|
||||
+
|
||||
+
|
||||
+wrapper(statx, int, (int dirfd, const char * pathname, int flags, unsigned int mask, struct statx * statxbuf))
|
||||
+{
|
||||
+ char fakechroot_abspath[FAKECHROOT_PATH_MAX];
|
||||
+ char fakechroot_buf[FAKECHROOT_PATH_MAX];
|
||||
+ debug("statx(%d, \"%s\", %d, %u, &statxbuf)", dirfd, pathname, flags, mask);
|
||||
+ expand_chroot_path_at(dirfd, pathname);
|
||||
+ return nextcall(statx)(dirfd, pathname, flags, mask, statxbuf);
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+typedef int empty_translation_unit;
|
||||
+#endif
|
|
@ -1,22 +0,0 @@
|
|||
--- fakechroot-2.8/src/libfakechroot.c.init 2008-10-05 10:18:21.000000000 +0200
|
||||
+++ fakechroot-2.8/src/libfakechroot.c 2008-10-05 10:21:45.000000000 +0200
|
||||
@@ -1778,7 +1778,8 @@
|
||||
char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
|
||||
|
||||
if (next_getpeername == NULL) fakechroot_init();
|
||||
- memset(&newname, 0, sizeof(struct sockaddr_un));
|
||||
+ newnamelen = sizeof(struct sockaddr_un);
|
||||
+ memset(&newname, 0, newnamelen);
|
||||
status = next_getpeername(s, (struct sockaddr *)&newname, &newnamelen);
|
||||
if (status != 0) {
|
||||
return status;
|
||||
@@ -1806,7 +1807,8 @@
|
||||
char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
|
||||
|
||||
if (next_getsockname == NULL) fakechroot_init();
|
||||
- memset(&newname, 0, sizeof(struct sockaddr_un));
|
||||
+ newnamelen = sizeof(struct sockaddr_un);
|
||||
+ memset(&newname, 0, newnamelen);
|
||||
status = next_getsockname(s, (struct sockaddr *)&newname, &newnamelen);
|
||||
if (status != 0) {
|
||||
return status;
|
|
@ -1,262 +0,0 @@
|
|||
Index: test/t/cmd-subst-pwd.sh
|
||||
===================================================================
|
||||
--- test/t/cmd-subst-pwd.sh (revision 0)
|
||||
+++ test/t/cmd-subst-pwd.sh (revision 0)
|
||||
@@ -0,0 +1,3 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+echo substituted
|
||||
|
||||
Property changes on: test/t/cmd-subst-pwd.sh
|
||||
___________________________________________________________________
|
||||
Added: svn:executable
|
||||
+ *
|
||||
|
||||
Index: test/t/cmd-subst.t
|
||||
===================================================================
|
||||
--- test/t/cmd-subst.t (revision 0)
|
||||
+++ test/t/cmd-subst.t (revision 0)
|
||||
@@ -0,0 +1,37 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+. ./tap.sh
|
||||
+
|
||||
+plan 5
|
||||
+
|
||||
+rm -rf testtree
|
||||
+
|
||||
+./testtree.sh testtree
|
||||
+test "`cat testtree/CHROOT`" = "testtree" || not
|
||||
+ok "testtree"
|
||||
+
|
||||
+t=`./fakechroot.sh testtree /bin/pwd`
|
||||
+test "$t" = "/" || not
|
||||
+ok "fakechroot pwd is /"
|
||||
+
|
||||
+export FAKECHROOT_CMD_SUBST="/bin/pwd=$(pwd)/t/cmd-subst-pwd.sh"
|
||||
+
|
||||
+t=`./fakechroot.sh testtree /bin/pwd`
|
||||
+test "$t" = "substituted" || not
|
||||
+ok "fakechroot substituted pwd (1)"
|
||||
+
|
||||
+export FAKECHROOT_CMD_SUBST="/no/file=foo:/bin/pwd=$(pwd)/t/cmd-subst-pwd.sh"
|
||||
+
|
||||
+t=`./fakechroot.sh testtree /bin/pwd`
|
||||
+test "$t" = "substituted" || not
|
||||
+ok "fakechroot substituted pwd (2)"
|
||||
+
|
||||
+export FAKECHROOT_CMD_SUBST="/no/file=foo:/other/file=bar"
|
||||
+
|
||||
+t=`./fakechroot.sh testtree /bin/pwd`
|
||||
+test "$t" = "/" || not
|
||||
+ok "fakechroot not substituted pwd is /"
|
||||
+
|
||||
+rm -rf testtree
|
||||
+
|
||||
+end
|
||||
|
||||
Property changes on: test/t/cmd-subst.t
|
||||
___________________________________________________________________
|
||||
Added: svn:executable
|
||||
+ *
|
||||
|
||||
Index: test/Makefile.am
|
||||
===================================================================
|
||||
--- test/Makefile.am (revision 334)
|
||||
+++ test/Makefile.am (working copy)
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
TESTS = \
|
||||
t/chroot.t \
|
||||
+ t/cmd-subst.t \
|
||||
t/escape-nested-chroot.t \
|
||||
t/pwd.t \
|
||||
t/touch.t \
|
||||
Index: src/libfakechroot.c
|
||||
===================================================================
|
||||
--- src/libfakechroot.c (revision 334)
|
||||
+++ src/libfakechroot.c (working copy)
|
||||
@@ -1467,7 +1467,38 @@
|
||||
return execve (path, argv, environ);
|
||||
}
|
||||
|
||||
+/* Parse the FAKECHROOT_CMD_SUBST environment variable (the first
|
||||
+ * parameter) and if there is a match with filename, return the
|
||||
+ * substitution in cmd_subst. Returns non-zero if there was a match.
|
||||
+ *
|
||||
+ * FAKECHROOT_CMD_SUBST=cmd=subst:cmd=subst:...
|
||||
+ */
|
||||
+static int
|
||||
+try_cmd_subst (char *env, const char *filename, char *cmd_subst)
|
||||
+{
|
||||
+ int len = strlen (filename), len2;
|
||||
+ char *p;
|
||||
|
||||
+ if (env == NULL) return 0;
|
||||
+
|
||||
+ do {
|
||||
+ p = strchrnul (env, ':');
|
||||
+
|
||||
+ if (strncmp (env, filename, len) == 0 && env[len] == '=') {
|
||||
+ len2 = p - &env[len+1];
|
||||
+ if (len2 >= FAKECHROOT_MAXPATH)
|
||||
+ len2 = FAKECHROOT_MAXPATH - 1;
|
||||
+ strncpy (cmd_subst, &env[len+1], len2);
|
||||
+ cmd_subst[len2] = '\0';
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ env = p;
|
||||
+ } while (*env++ != '\0');
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* #include <unistd.h> */
|
||||
int execve (const char *filename, char *const argv [], char *const envp[])
|
||||
{
|
||||
@@ -1479,32 +1510,16 @@
|
||||
char *env;
|
||||
char tmp[FAKECHROOT_MAXPATH], newfilename[FAKECHROOT_MAXPATH], argv0[FAKECHROOT_MAXPATH];
|
||||
char *ptr;
|
||||
- unsigned int i, j, n, len;
|
||||
+ unsigned int i, j, n, len, r, newenvppos;
|
||||
size_t sizeenvp;
|
||||
char c;
|
||||
char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
|
||||
char *envkey[] = { "FAKECHROOT", "FAKECHROOT_BASE",
|
||||
"FAKECHROOT_VERSION", "FAKECHROOT_EXCLUDE_PATH",
|
||||
+ "FAKECHROOT_CMD_SUBST",
|
||||
"LD_LIBRARY_PATH", "LD_PRELOAD" };
|
||||
+ const int nr_envkey = sizeof envkey / sizeof envkey[0];
|
||||
|
||||
- strncpy(argv0, filename, FAKECHROOT_MAXPATH);
|
||||
-
|
||||
- expand_chroot_path(filename, fakechroot_path, fakechroot_ptr, fakechroot_buf);
|
||||
- strcpy(tmp, filename);
|
||||
- filename = tmp;
|
||||
-
|
||||
- if ((file = open(filename, O_RDONLY)) == -1) {
|
||||
- errno = ENOENT;
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- i = read(file, hashbang, FAKECHROOT_MAXPATH-2);
|
||||
- close(file);
|
||||
- if (i == -1) {
|
||||
- errno = ENOENT;
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
if (next_execve == NULL) fakechroot_init();
|
||||
|
||||
/* Scan envp and check its size */
|
||||
@@ -1514,39 +1529,69 @@
|
||||
}
|
||||
|
||||
/* Copy envp to newenvp */
|
||||
- newenvp = malloc( sizeenvp * sizeof (char *) + sizeof(envkey) );
|
||||
+ newenvp = malloc( (sizeenvp + 1) * sizeof (char *) );
|
||||
if (newenvp == NULL) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
- for (ep = (char **)envp, i = 0; *ep != NULL; ++ep) {
|
||||
- for (j = 0; j < sizeof (envkey) / sizeof (char *); j++) {
|
||||
+ for (ep = (char **) envp, newenvppos = 0; *ep != NULL; ++ep) {
|
||||
+ for (j = 0; j < nr_envkey; j++) {
|
||||
len = strlen (envkey[j]);
|
||||
if (strncmp (*ep, envkey[j], len) == 0 && (*ep)[len] == '=')
|
||||
goto skip;
|
||||
}
|
||||
- newenvp[i] = *ep;
|
||||
- i++;
|
||||
+ newenvp[newenvppos] = *ep;
|
||||
+ newenvppos++;
|
||||
skip: ;
|
||||
}
|
||||
+ newenvp[newenvppos] = NULL;
|
||||
|
||||
+ strncpy(argv0, filename, FAKECHROOT_MAXPATH);
|
||||
+
|
||||
+ r = try_cmd_subst (getenv ("FAKECHROOT_CMD_SUBST"), filename, tmp);
|
||||
+ if (r) {
|
||||
+ filename = tmp;
|
||||
+
|
||||
+ /* FAKECHROOT_CMD_SUBST escapes the chroot. newenvp here does
|
||||
+ * not contain LD_PRELOAD and the other special environment
|
||||
+ * variables.
|
||||
+ */
|
||||
+ return next_execve(filename, argv, newenvp);
|
||||
+ }
|
||||
+
|
||||
+ expand_chroot_path(filename, fakechroot_path, fakechroot_ptr, fakechroot_buf);
|
||||
+ strcpy(tmp, filename);
|
||||
+ filename = tmp;
|
||||
+
|
||||
+ if ((file = open(filename, O_RDONLY)) == -1) {
|
||||
+ errno = ENOENT;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ i = read(file, hashbang, FAKECHROOT_MAXPATH-2);
|
||||
+ close(file);
|
||||
+ if (i == -1) {
|
||||
+ errno = ENOENT;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* Add our variables to newenvp */
|
||||
- newenvp = realloc( newenvp, i * sizeof(char *) + sizeof(envkey) );
|
||||
+ newenvp = realloc( newenvp, (newenvppos + nr_envkey + 1) * sizeof(char *) );
|
||||
if (newenvp == NULL) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
- for (j = 0; j < sizeof(envkey) / sizeof(char *); j++) {
|
||||
+ for (j = 0; j < nr_envkey; j++) {
|
||||
env = getenv(envkey[j]);
|
||||
if (env != NULL) {
|
||||
- newenvp[i] = malloc(strlen(envkey[j]) + strlen(env) + 3);
|
||||
- strcpy(newenvp[i], envkey[j]);
|
||||
- strcat(newenvp[i], "=");
|
||||
- strcat(newenvp[i], env);
|
||||
- i++;
|
||||
+ newenvp[newenvppos] = malloc(strlen(envkey[j]) + strlen(env) + 3);
|
||||
+ strcpy(newenvp[newenvppos], envkey[j]);
|
||||
+ strcat(newenvp[newenvppos], "=");
|
||||
+ strcat(newenvp[newenvppos], env);
|
||||
+ newenvppos++;
|
||||
}
|
||||
}
|
||||
- newenvp[i] = NULL;
|
||||
+ newenvp[newenvppos] = NULL;
|
||||
|
||||
/* No hashbang in argv */
|
||||
if (hashbang[0] != '#' || hashbang[1] != '!')
|
||||
Index: man/fakechroot.pod
|
||||
===================================================================
|
||||
--- man/fakechroot.pod (revision 334)
|
||||
+++ man/fakechroot.pod (working copy)
|
||||
@@ -139,6 +139,21 @@
|
||||
The list of directories which are excluded from being chrooted. The elements
|
||||
of list are separated with colon.
|
||||
|
||||
+=item B<FAKECHROOT_CMD_SUBST>
|
||||
+
|
||||
+A list of command substitutions. If a program tries to execute one of
|
||||
+the commands given (path relative to the chroot) then the substitute
|
||||
+command runs instead (path to substitute command is not chrooted).
|
||||
+
|
||||
+For example:
|
||||
+
|
||||
+ FAKECHROOT_CMD_SUBST=/sbin/ldconfig=/tmp/ldconfig-wrapper
|
||||
+
|
||||
+will substitute C</tmp/ldconfig-wrapper> for C</sbin/ldconfig>.
|
||||
+
|
||||
+Give as many substitute commands as you want, separated by C<:>
|
||||
+(colon) characters.
|
||||
+
|
||||
=item B<LD_LIBRARY_PATH>, B<LD_PRELOAD>
|
||||
|
||||
Fakechroot is implemented by wrapping system calls. This is accomplished by
|
|
@ -1,25 +0,0 @@
|
|||
diff -ur fakechroot-2.9/autogen.sh fakechroot-2.9-no-automake-version/autogen.sh
|
||||
--- fakechroot-2.9/autogen.sh 2009-03-19 14:43:19.000000000 +0000
|
||||
+++ fakechroot-2.9-no-automake-version/autogen.sh 2009-06-12 10:03:49.897687490 +0100
|
||||
@@ -5,18 +5,16 @@
|
||||
set -e
|
||||
|
||||
autogen () {
|
||||
- automake_version=1.10
|
||||
-
|
||||
rm -f Makefile Makefile.in aclocal.m4
|
||||
rm -f config.guess config.h config.h.in config.log
|
||||
rm -f config.status config.sub configure
|
||||
rm -f depcomp install-sh libtool ltmain.sh missing stamp-h1
|
||||
rm -rf autom4te.cache
|
||||
|
||||
- aclocal-${automake_version} "$@"
|
||||
+ aclocal "$@"
|
||||
autoheader
|
||||
libtoolize --force --copy
|
||||
- automake-${automake_version} --add-missing --copy
|
||||
+ automake --add-missing --copy
|
||||
autoconf
|
||||
|
||||
rm -rf autom4te.cache
|
||||
Only in fakechroot-2.9-no-automake-version: autogen.sh~
|
|
@ -1,113 +0,0 @@
|
|||
Index: m4/scandir_argtypes.m4
|
||||
===================================================================
|
||||
--- m4/scandir_argtypes.m4 (revision 334)
|
||||
+++ m4/scandir_argtypes.m4 (working copy)
|
||||
@@ -12,7 +12,7 @@
|
||||
for ac_arg1 in 'const char *dir'; do
|
||||
for ac_arg2 in 'struct dirent ***namelist'; do
|
||||
for ac_arg3 in 'int(*filter)(const struct dirent *)' 'int(*filter)(struct dirent *)'; do
|
||||
- for ac_arg4 in 'int(*compar)(const void *,const void *)'; do
|
||||
+ for ac_arg4 in 'int(*compar)(const void *,const void *)' 'int(*compar)(const struct dirent **, const struct dirent **)'; do
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[AC_INCLUDES_DEFAULT
|
||||
@@ -46,3 +46,52 @@
|
||||
[Define to the type of arg 4 for `scandir'.])
|
||||
rm -f conftest*
|
||||
])
|
||||
+
|
||||
+dnl AC_FUNC_SCANDIR64_ARGTYPES
|
||||
+dnl -------------------------
|
||||
+dnl Determine the correct type to be passed to each of the `scandir64'
|
||||
+dnl function's arguments, and define those types in `SCANDIR64_TYPE_ARG1',
|
||||
+dnl `SCANDIR64_TYPE_ARG2', `SCANDIR64_TYPE_ARG3' and `SCANDIR64_TYPE_ARG4'.
|
||||
+AN_FUNCTION([scandir64], [AC_FUNC_SCANDIR64_ARGTYPES])
|
||||
+AC_DEFUN([AC_FUNC_SCANDIR64_ARGTYPES],
|
||||
+[AC_CHECK_HEADERS(dirent.h)
|
||||
+AC_CACHE_CHECK([types of arguments for scandir64],
|
||||
+[ac_cv_func_scandir64_args],
|
||||
+[for ac_return in 'int'; do
|
||||
+ for ac_arg1 in 'const char *dir'; do
|
||||
+ for ac_arg2 in 'struct dirent64 ***namelist'; do
|
||||
+ for ac_arg3 in 'int(*filter)(const struct dirent64 *)' 'int(*filter)(struct dirent64 *)'; do
|
||||
+ for ac_arg4 in 'int(*compar)(const void *,const void *)' 'int(*compar)(const struct dirent64 **, const struct dirent64 **)'; do
|
||||
+ AC_COMPILE_IFELSE(
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+[AC_INCLUDES_DEFAULT
|
||||
+#ifdef HAVE_UNISTD_H
|
||||
+#include <dirent.h>
|
||||
+#endif
|
||||
+],
|
||||
+ [extern $ac_return scandir64 ($ac_arg1, $ac_arg2, $ac_arg3, $ac_arg4);])],
|
||||
+ [ac_cv_func_scandir64_args="$ac_return;$ac_arg1;$ac_arg2;$ac_arg3;$ac_arg4"; break 5])
|
||||
+ done
|
||||
+ done
|
||||
+ done
|
||||
+ done
|
||||
+done
|
||||
+# Provide a safe default value.
|
||||
+: ${ac_cv_func_scandir64_args='(default) int;const char *dir;struct dirent64 ***namelist;int(*filter)(const struct dirent64 *);int(*compar)(const void *,const void *)'}
|
||||
+])
|
||||
+ac_save_IFS=$IFS; IFS=';'
|
||||
+set dummy `echo "$ac_cv_func_scandir64_args" | sed 's/^(default) //' | sed 's/\*/\*/g'`
|
||||
+IFS=$ac_save_IFS
|
||||
+shift
|
||||
+AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_RETURN, $[1],
|
||||
+ [Define to the type of return value for `scandir64'.])
|
||||
+AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG1, $[2],
|
||||
+ [Define to the type of arg 1 for `scandir64'.])
|
||||
+AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG2, $[3],
|
||||
+ [Define to the type of arg 2 for `scandir64'.])
|
||||
+AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG3, $[4],
|
||||
+ [Define to the type of arg 3 for `scandir64'.])
|
||||
+AC_DEFINE_UNQUOTED(SCANDIR64_TYPE_ARG4, $[5],
|
||||
+ [Define to the type of arg 4 for `scandir64'.])
|
||||
+rm -f conftest*
|
||||
+])
|
||||
Index: src/libfakechroot.c
|
||||
===================================================================
|
||||
--- src/libfakechroot.c (revision 334)
|
||||
+++ src/libfakechroot.c (working copy)
|
||||
@@ -512,10 +512,10 @@
|
||||
#endif
|
||||
static int (*next_rmdir) (const char *pathname) = NULL;
|
||||
#ifdef HAVE_SCANDIR
|
||||
-static int (*next_scandir) (const char *dir, struct dirent ***namelist, SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *)) = NULL;
|
||||
+static int (*next_scandir) (SCANDIR_TYPE_ARG1, SCANDIR_TYPE_ARG2, SCANDIR_TYPE_ARG3, SCANDIR_TYPE_ARG4) = NULL;
|
||||
#endif
|
||||
#ifdef HAVE_SCANDIR64
|
||||
-static int (*next_scandir64) (const char *dir, struct dirent64 ***namelist, int(*filter)(const struct dirent64 *), int(*compar)(const void *, const void *)) = NULL;
|
||||
+static int (*next_scandir64) (SCANDIR64_TYPE_ARG1, SCANDIR64_TYPE_ARG2, SCANDIR64_TYPE_ARG3, SCANDIR64_TYPE_ARG4) = NULL;
|
||||
#endif
|
||||
#ifdef HAVE_SETXATTR
|
||||
static int (*next_setxattr) (const char *path, const char *name, const void *value, size_t size, int flags) = NULL;
|
||||
@@ -2619,7 +2619,7 @@
|
||||
|
||||
#ifdef HAVE_SCANDIR
|
||||
/* #include <dirent.h> */
|
||||
-int scandir (const char *dir, struct dirent ***namelist, SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *))
|
||||
+int scandir (SCANDIR_TYPE_ARG1, SCANDIR_TYPE_ARG2, SCANDIR_TYPE_ARG3, SCANDIR_TYPE_ARG4)
|
||||
{
|
||||
char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
|
||||
expand_chroot_path(dir, fakechroot_path, fakechroot_ptr, fakechroot_buf);
|
||||
@@ -2631,7 +2631,7 @@
|
||||
|
||||
#ifdef HAVE_SCANDIR64
|
||||
/* #include <dirent.h> */
|
||||
-int scandir64 (const char *dir, struct dirent64 ***namelist, int(*filter)(const struct dirent64 *), int(*compar)(const void *, const void *))
|
||||
+int scandir64 (SCANDIR64_TYPE_ARG1, SCANDIR64_TYPE_ARG2, SCANDIR64_TYPE_ARG3, SCANDIR64_TYPE_ARG4)
|
||||
{
|
||||
char *fakechroot_path, *fakechroot_ptr, fakechroot_buf[FAKECHROOT_MAXPATH];
|
||||
expand_chroot_path(dir, fakechroot_path, fakechroot_ptr, fakechroot_buf);
|
||||
Index: configure.ac
|
||||
===================================================================
|
||||
--- configure.ac (revision 334)
|
||||
+++ configure.ac (working copy)
|
||||
@@ -177,6 +177,7 @@
|
||||
|
||||
AC_FUNC_READLINK_ARGTYPES
|
||||
AC_FUNC_SCANDIR_ARGTYPES
|
||||
+AC_FUNC_SCANDIR64_ARGTYPES
|
||||
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
205
fakechroot.spec
205
fakechroot.spec
|
@ -1,28 +1,30 @@
|
|||
Summary: Gives a fake chroot environment
|
||||
Name: fakechroot
|
||||
Version: 2.9
|
||||
Release: 24%{?dist}
|
||||
License: LGPLv2+
|
||||
Group: Development/Tools
|
||||
URL: http://fakechroot.alioth.debian.org/
|
||||
Source0: http://ftp.debian.org/debian/pool/main/f/fakechroot/%{name}_%{version}.orig.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
Requires: fakechroot-libs = %{version}-%{release}
|
||||
Name: fakechroot
|
||||
Version: 2.20.1
|
||||
Release: 11%{?dist}
|
||||
Summary: Gives a fake chroot environment
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/dex4er/fakechroot
|
||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
Patch1: https://github.com/dex4er/fakechroot/commit/b42d1fb9538f680af2f31e864c555414ccba842a.patch
|
||||
Patch2: https://github.com/dex4er/fakechroot/pull/85/commits/534e6d555736b97211523970d378dfb0db2608e9.patch
|
||||
Patch3: https://github.com/dex4er/fakechroot/pull/85/commits/75d7e6fa191c11a791faff06a0de86eaa7801d05.patch
|
||||
Patch4: https://github.com/dex4er/fakechroot/pull/85/commits/693a3597ea7fccfb62f357503ff177bd3e3d5a89.patch
|
||||
Patch5: https://github.com/dex4er/fakechroot/pull/86.patch
|
||||
Patch6: fix_test_on_32bits.patch
|
||||
|
||||
# Required for patch0:
|
||||
BuildRequires: autoconf, automake >= 1.10, libtool
|
||||
|
||||
# Fix build problems with recent glibc. Sent upstream 20090414.
|
||||
Patch0: fakechroot-scandir.patch
|
||||
|
||||
# Add FAKECHROOT_CMD_SUBST feature.
|
||||
# Sent upstream 20090413. Accepted upstream 20090418.
|
||||
Patch1: fakechroot-cmd-subst.patch
|
||||
|
||||
# autogen script depends on a specific automake version, for no
|
||||
# real reason AFAICT. This means the package breaks everytime
|
||||
# a new version of automake is released. - RWMJ.
|
||||
Patch2: fakechroot-no-automake-version.patch
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
# Required for manpage
|
||||
BuildRequires: /usr/bin/pod2man
|
||||
BuildRequires: gdbm-libs
|
||||
# ldd.fakechroot
|
||||
Requires: /usr/bin/objdump
|
||||
|
||||
%description
|
||||
fakechroot runs a command in an environment were is additionally
|
||||
|
@ -31,51 +33,154 @@ useful for allowing users to create their own chrooted environment
|
|||
with possibility to install another packages without need for root
|
||||
privileges.
|
||||
|
||||
%package libs
|
||||
Summary: Gives a fake chroot environment (libraries)
|
||||
Group: Development/Tools
|
||||
%package libs
|
||||
Summary: Libraries of %{name}
|
||||
|
||||
%description libs
|
||||
%description libs
|
||||
This package contains the libraries required by %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autosetup -p1
|
||||
# For %%doc dependency-clean.
|
||||
chmod -x scripts/{relocatesymlinks,restoremode,savemode}.sh
|
||||
|
||||
%patch0 -p0
|
||||
%patch1 -p0
|
||||
%patch2 -p1
|
||||
|
||||
# Patch0 updates autoconf, so rerun this:
|
||||
./autogen.sh
|
||||
#rm test/t/escape-nested-chroot.t
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--disable-dependency-tracking \
|
||||
--disable-static
|
||||
make
|
||||
autoreconf -vfi
|
||||
|
||||
%if 0%{?__isa_bits} == 64
|
||||
%configure --disable-static --disable-silent-rules --with-libpath="%{_libdir}/fakechroot:/usr/lib/fakechroot"
|
||||
%else
|
||||
%configure --disable-static --disable-silent-rules --with-libpath="%{_libdir}/fakechroot:/usr/lib64/fakechroot"
|
||||
%endif
|
||||
|
||||
%make_build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make install DESTDIR=%{buildroot}
|
||||
%make_install
|
||||
# Drop libtool files
|
||||
find %{buildroot}%{_libdir} -name '*.la' -delete -print
|
||||
|
||||
%check
|
||||
#make check
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
%make_build check
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE scripts/ldd.fake scripts/restoremode.sh scripts/savemode.sh
|
||||
%{_bindir}/fakechroot
|
||||
%{_mandir}/man1/fakechroot.1.gz
|
||||
%doc scripts/{relocatesymlinks,restoremode,savemode}.sh
|
||||
%doc NEWS.md README.md THANKS.md
|
||||
%license COPYING LICENSE
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/env.%{name}
|
||||
%{_bindir}/ldd.%{name}
|
||||
%{_sbindir}/chroot.%{name}
|
||||
%dir %{_sysconfdir}/%{name}/
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/chroot.env
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/debootstrap.env
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/rinse.env
|
||||
%{_mandir}/man1/%{name}.1*
|
||||
|
||||
%files libs
|
||||
%dir %{_libdir}/fakechroot
|
||||
%exclude %{_libdir}/fakechroot/libfakechroot.la
|
||||
%{_libdir}/fakechroot/libfakechroot.so
|
||||
%{_libdir}/%{name}/
|
||||
|
||||
%changelog
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
- Fix build with https://github.com/dex4er/fakechroot/pull/85 and
|
||||
https://github.com/dex4er/fakechroot/pull/86
|
||||
|
||||
* Sat Aug 29 2020 Sérgio Basto <sergio@serjux.com> - 2.20.1-7
|
||||
- Use upstream fix for t/escape-nested-chroot.t
|
||||
|
||||
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-6
|
||||
- Second attempt - Rebuilt for
|
||||
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
- Disable escape-nested-chroot test temporarily
|
||||
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Feb 12 2020 Sérgio Basto <sergio@serjux.com> - 2.20.1-4
|
||||
- Use if "%{_libdir}" == "/usr/lib64" instead %if 0%{__isa_bits} == 64
|
||||
|
||||
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Fri Jan 24 2020 Sérgio Basto <sergio@serjux.com> - 2.20.1-2
|
||||
- (#1241555) fakechroot isn't multilib
|
||||
|
||||
* Fri Oct 18 2019 Sérgio Basto <sergio@serjux.com> - 2.20.1-1
|
||||
- Update to 2.20.1 (#1689666)
|
||||
- Drop upstreamed patch
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Mon Aug 21 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.19-4
|
||||
- Add support for LFS
|
||||
|
||||
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.19-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Tue Feb 07 2017 Sérgio Basto <sergio@serjux.com> - 2.19-1
|
||||
- Update fakechroot to 2.19 (#1396855)
|
||||
|
||||
* Wed May 18 2016 Igor Gnatenko <ignatenko@redhat.com> - 2.18-1
|
||||
- Update to 2.18
|
||||
|
||||
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.17.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.17.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Mon Mar 02 2015 Christopher Meng <rpm@cicku.me> - 2.17.2-1
|
||||
- Update to 2.17.2
|
||||
|
||||
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-32
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-31
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-30
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Mon Feb 25 2013 Ralf Corsépius <corsepiu@fedoraproject.org> - 2.9-29
|
||||
- Add BR: /usr/bin/pod2man (Fix FTBFS #913997).
|
||||
|
||||
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-28
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-27
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-26
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-25
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9-24
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
removing leading / for some reason cp doesn't like it
|
||||
--- fakechroot-2.20.1/test/t/cp.t 2019-03-22 21:02:42.000000000 +0000
|
||||
+++ fakechroot-2.20.1/test/t/cp.t 2022-03-04 02:07:11.511455404 +0000
|
||||
@@ -19,13 +19,13 @@ for chroot in chroot fakechroot; do
|
||||
else
|
||||
|
||||
echo 'something' > $testtree/file-$chroot
|
||||
- ln -s /file-$chroot $testtree/symlink-$chroot
|
||||
+ ln -s file-$chroot $testtree/symlink-$chroot
|
||||
|
||||
- t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS /file-$chroot /file2-$chroot; cat /file2-$chroot" 2>&1`
|
||||
+ t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS file-$chroot file2-$chroot; cat /file2-$chroot" 2>&1`
|
||||
test "$t" = "something" || not
|
||||
- ok "$chroot cp $CP_ARGS /file-$chroot /file2-$chroot:" $t
|
||||
+ ok "$chroot cp $CP_ARGS file-$chroot file2-$chroot:" $t
|
||||
|
||||
- t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS /symlink-$chroot /symlink2-$chroot; cat /symlink2-$chroot" 2>&1`
|
||||
+ t=`$srcdir/$chroot.sh $testtree /bin/sh -c "cp $CP_ARGS symlink-$chroot symlink2-$chroot; cat /symlink2-$chroot" 2>&1`
|
||||
test "$t" = "something" || not
|
||||
ok "$chroot cp $CP_ARGS /symlink-$chroot /symlink2-$chroot:" $t
|
||||
|
Loading…
Reference in New Issue