[arch-commits] Commit in fakechroot/trunk (2 files)
Allan McRae
allan at nymeria.archlinux.org
Sat Dec 14 00:09:01 UTC 2013
Date: Saturday, December 14, 2013 @ 01:09:01
Author: allan
Revision: 201530
upgpkg: fakechroot 2.17.1-2
fix chroot path sanitizing
Added:
fakechroot/trunk/fakechroot-2.17.1-sanitize-chroot-path.patch
Modified:
fakechroot/trunk/PKGBUILD
----------------------------------------------+
PKGBUILD | 13 +++++--
fakechroot-2.17.1-sanitize-chroot-path.patch | 44 +++++++++++++++++++++++++
2 files changed, 54 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2013-12-13 21:18:56 UTC (rev 201529)
+++ PKGBUILD 2013-12-14 00:09:01 UTC (rev 201530)
@@ -4,16 +4,23 @@
pkgname=fakechroot
pkgver=2.17.1
-pkgrel=1
+pkgrel=2
pkgdesc="Gives a fake chroot environment"
arch=('i686' 'x86_64')
url="https://github.com/dex4er/fakechroot/wiki"
license=('LGPL')
install=fakechroot.install
-source=(https://github.com/dex4er/fakechroot/archive/${pkgver}.tar.gz)
-md5sums=('3c17eff0c854a77f98b4d0db086bc5bc')
+source=(https://github.com/dex4er/fakechroot/archive/${pkgver}.tar.gz
+ fakechroot-2.17.1-sanitize-chroot-path.patch)
+md5sums=('3c17eff0c854a77f98b4d0db086bc5bc'
+ 'fadc56f4b4dd67ba362c5ac41f5cb293')
+prepare() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ patch -p1 -i ${srcdir}/fakechroot-2.17.1-sanatise-chroot-path.patch
+}
+
build() {
cd ${srcdir}/${pkgname}-${pkgver}
./configure --prefix=/usr --sbindir=/usr/bin \
Added: fakechroot-2.17.1-sanitize-chroot-path.patch
===================================================================
--- fakechroot-2.17.1-sanitize-chroot-path.patch (rev 0)
+++ fakechroot-2.17.1-sanitize-chroot-path.patch 2013-12-14 00:09:01 UTC (rev 201530)
@@ -0,0 +1,44 @@
+From 922b9be90ccce8f5b01339864f499f6d77505c5f Mon Sep 17 00:00:00 2001
+From: Andrew Gregory <andrew.gregory.8 at gmail.com>
+Date: Fri, 13 Dec 2013 12:31:00 -0500
+Subject: [PATCH] chroot: sanitize path
+
+path was not being sanitized if it started with '/' causing chroot calls
+to fail when path ended with '/'.
+
+Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
+---
+ src/chroot.c | 3 +++
+ test/t/chroot.t | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/chroot.c b/src/chroot.c
+index 9e15ff5..7917a9a 100644
+--- a/src/chroot.c
++++ b/src/chroot.c
+@@ -76,6 +76,9 @@
+ else {
+ if (*path == '/') {
+ expand_chroot_rel_path(path);
++ strlcpy(tmp, path, FAKECHROOT_PATH_MAX);
++ dedotdot(tmpptr);
++ path = tmpptr;
+ }
+ else {
+ snprintf(tmp, FAKECHROOT_PATH_MAX, "%s/%s", cwd, path);
+diff --git a/test/t/chroot.t b/test/t/chroot.t
+index e532a6f..286b863 100755
+--- a/test/t/chroot.t
++++ b/test/t/chroot.t
+@@ -14,7 +14,7 @@ for chroot in chroot fakechroot; do
+ skip $(( $tap_plan / 2 )) "not root"
+ else
+
+- for testtree in testtree2 /testtree2 ./testtree2 /./testtree2 testtree2/. testtree2/./.; do
++ for testtree in testtree2 /testtree2 ./testtree2 /./testtree2 testtree2/. testtree2/./. testtree2/; do
+ t=`$srcdir/$chroot.sh testtree /usr/sbin/chroot $testtree /bin/cat /CHROOT 2>&1`
+ test "$t" = "testtree/testtree2" || not
+ ok "$chroot chroot $testtree:" $t
+--
+1.8.5.1
+
More information about the arch-commits
mailing list