summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/proot/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-apps/proot/files')
-rw-r--r--sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch19
-rw-r--r--sys-apps/proot/files/proot-3.2.1-makefile.patch11
-rw-r--r--sys-apps/proot/files/proot-3.2.2-build-care.patch20
-rw-r--r--sys-apps/proot/files/proot-4.0.1-argv.patch125
4 files changed, 175 insertions, 0 deletions
diff --git a/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
new file mode 100644
index 000000000000..43c0d03d978a
--- /dev/null
+++ b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
@@ -0,0 +1,19 @@
+--- src/execve/ldso.c 2013-01-23 16:22:37.870287856 +0400
++++ src/execve/ldso.c 2013-01-23 16:31:40.219283675 +0400
+@@ -285,16 +285,10 @@
+ /* 6. /lib, /usr/lib + /usr/local/lib */
+ if (IS_CLASS32(elf_header))
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+- "/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:"
+-#endif
+ "/lib32:/usr/lib32:/usr/local/lib32"
+ ":/lib:/usr/lib:/usr/local/lib");
+ else
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86_64)
+- "/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:"
+-#endif
+ "/lib64:/usr/lib64:/usr/local/lib64"
+ ":/lib:/usr/lib:/usr/local/lib");
+ if (status < 0)
diff --git a/sys-apps/proot/files/proot-3.2.1-makefile.patch b/sys-apps/proot/files/proot-3.2.1-makefile.patch
new file mode 100644
index 000000000000..854c48ef0817
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.1-makefile.patch
@@ -0,0 +1,11 @@
+--- src/GNUmakefile.orig 2013-12-06 10:47:18.554784621 +0400
++++ src/GNUmakefile 2013-12-06 10:47:43.129785804 +0400
+@@ -9,7 +9,7 @@
+ CC = gcc
+ LD = $(CC)
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)
+-CFLAGS += -Wall -Wextra -O2
++CFLAGS += -Wall -Wextra
+ LDFLAGS += -ltalloc
+
+ OBJECTS = \
diff --git a/sys-apps/proot/files/proot-3.2.2-build-care.patch b/sys-apps/proot/files/proot-3.2.2-build-care.patch
new file mode 100644
index 000000000000..c52a39cf787b
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.2-build-care.patch
@@ -0,0 +1,20 @@
+Skip check for building care, patch by Patrick Lauer <patrick AT gentoo.org>
+
+--- src/GNUmakefile 2014-02-25 16:42:04.336863622 +0800
++++ src/GNUmakefile.new 2014-02-25 16:42:26.063050467 +0800
+@@ -54,15 +54,6 @@
+ all: proot
+
+ ######################################################################
+-# Sanity checks
+-
+-ifneq (,$(findstring care,$(MAKECMDGOALS)))
+-ifneq ($(CARE_BUILD_ENV),ok)
+-$(error care is supposed to be built with: http://build.reproducible.io)
+-endif
+-endif
+-
+-######################################################################
+ # Beautified output
+
+ quiet_GEN = @echo " GEN $@"; $(GEN)
diff --git a/sys-apps/proot/files/proot-4.0.1-argv.patch b/sys-apps/proot/files/proot-4.0.1-argv.patch
new file mode 100644
index 000000000000..df580563458c
--- /dev/null
+++ b/sys-apps/proot/files/proot-4.0.1-argv.patch
@@ -0,0 +1,125 @@
+commit 520fa3601c36dd0a3c84e310bd2a1189259000bd
+Author: Cédric VINCENT <cedric.vincent@st.com>
+Date: Thu Aug 7 14:29:37 2014 +0200
+
+ Don't dereference argv[0] when launching a script through a symlink.
+
+ Reported-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+ Ref: https://bugs.gentoo.org/show_bug.cgi?id=517496
+
+ Also, don't complain about non-regular or non-executable files that
+ are not explicitely candidates.
+
+diff --git a/src/path/path.c b/src/path/path.c
+index 4225876..ecdef70 100644
+--- a/src/path/path.c
++++ b/src/path/path.c
+@@ -219,17 +219,21 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ /* Is the command available without any $PATH look-up? */
+ status = realpath2(tracee, host_path, command, true);
+ if (status == 0 && stat(host_path, &statr) == 0) {
+- if (!S_ISREG(statr.st_mode)) {
++ if (is_explicit && !S_ISREG(statr.st_mode)) {
+ notice(tracee, ERROR, USER, "'%s' is not a regular file", command);
+ return -EACCES;
+ }
+
+- if ((statr.st_mode & S_IXUSR) == 0) {
++ if (is_explicit && (statr.st_mode & S_IXUSR) == 0) {
+ notice(tracee, ERROR, USER, "'%s' is not executable", command);
+ return -EACCES;
+ }
+
+ found = true;
++
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, command, false);
+ }
+ else
+ found = false;
+@@ -274,8 +278,12 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ if (status == 0
+ && stat(host_path, &statr) == 0
+ && S_ISREG(statr.st_mode)
+- && (statr.st_mode & S_IXUSR) != 0)
+- return 0;
++ && (statr.st_mode & S_IXUSR) != 0) {
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, path, false);
++ return 0;
++ }
+ } while (*(cursor - 1) != '\0');
+
+ not_found:
+diff --git a/src/tracee/event.c b/src/tracee/event.c
+index 70668d6..5905c43 100644
+--- a/src/tracee/event.c
++++ b/src/tracee/event.c
+@@ -92,7 +92,7 @@ int launch_process(Tracee *tracee)
+ * guest rootfs. Note: Valgrind can't handle execve(2) on
+ * "foreign" binaries (ENOEXEC) but can handle execvp(3) on such
+ * binaries. */
+- execvp(tracee->exe, tracee->cmdline);
++ execv(tracee->exe, tracee->cmdline);
+ return -errno;
+
+ default: /* parent */
+diff --git a/tests/test-713b6910.sh b/tests/test-713b6910.sh
+new file mode 100644
+index 0000000..82e01fd
+--- /dev/null
++++ b/tests/test-713b6910.sh
+@@ -0,0 +1,51 @@
++if [ -z `which mcookie` ] || [ -z `which rm` ] || [ -z `which cat` ] || [ -z `which chmod` ] || [ -z `which ln` ] || [ -z `which grep` ] || [ -z `which mkdir` ] || [ ! -x ${ROOTFS}/bin/readlink ]; then
++ exit 125;
++fi
++
++######################################################################
++
++TMP1=/tmp/$(mcookie)
++TMP2=/tmp/$(mcookie)
++TMP3=/tmp/$(mcookie)
++TMP4=/tmp/$(mcookie)
++
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}
++
++######################################################################
++
++cat > ${TMP1} <<'EOF'
++#!/bin/sh
++echo $0
++EOF
++
++chmod +x ${TMP1}
++ln -s ${TMP1} ${TMP2}
++
++${PROOT} ${TMP2} | grep -v ${TMP1}
++${PROOT} ${TMP2} | grep ${TMP2}
++
++######################################################################
++
++mkdir -p ${TMP3}
++cd ${TMP3}
++
++ln -s $(which true) false
++! ${PROOT} false
++
++echo "#!$(which false)" > true
++chmod a-x true
++${PROOT} true
++
++######################################################################
++
++ln -s ${ROOTFS}/bin/readlink ${TMP4}
++
++TEST1=$(${PROOT} ${ROOTFS}/bin/readlink /proc/self/exe)
++TEST2=$(${PROOT} ${TMP4} /proc/self/exe)
++
++test "${TEST1}" = "${TEST2}"
++
++######################################################################
++
++cd /
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}