Package: fakechroot
Version: 2.17.2-1
Severity: normal
Tags: patch

Dear Maintainer,

It is possible to change to a directory outside of $FAKECHROOT_BASE :

$ pwd
/home/me
$ mkdir outside
$ fakechroot fakeroot chroot my_chroot/
# pwd
/
# cd ../outside
# pwd
/home/me/outside

Is this the correct behavior ?

With the following patch applied, the previous example gives :

$ fakechroot fakeroot chroot my_chroot/
# pwd
/
# cd ../outside
bash: cd: ../outside: No such file or directory
# pwd
/

(which is the outcome I expected instead)

Thanks for your comments or corrections !

Regards,
JH Chatenet

*** rustine13.patch
diff -Naur a/src/chdir.c b/src/chdir.c
--- a/src/chdir.c       2014-03-18 09:48:51.000000000 +0100
+++ b/src/chdir.c       2014-03-18 09:49:35.000000000 +0100
@@ -36,7 +36,7 @@
         return -1;
     }
     if (fakechroot_base != NULL) {
-        if (strstr(cwd, fakechroot_base) == path) {
+        if (strstr(cwd, fakechroot_base) == cwd) {
             expand_chroot_path(path);
         }
         else {


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages fakechroot depends on:
ii  libfakechroot  2.17.2-1

fakechroot recommends no packages.

fakechroot suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to