Package: dchroot
Version: 0.10
Severity: wishlist
Tags: patch
Hello
My $HOME is a symlink to /mnt/local/home/ch. Whenever I execute
"dchroot" from within my home directory and supply the "-d" parameter
to preserve the environment variables it fails as in the chroot there
is only /home/ch but not /mnt/local/home/ch.
The following patch at least changes the path to / inside the chroot
which is perfectly ok for both, just starting a program or executing an
interactive shell.
bye,
-christian-
diff -u dchroot-0.10/dchroot.c dchroot-neu/dchroot.c
--- dchroot-0.10/dchroot.c 2004-07-01 20:14:13.000000000 +0200
+++ dchroot-neu/dchroot.c 2005-03-15 20:52:44.043822074 +0100
@@ -298,8 +298,14 @@
if (opts.dir[0] != '\0') {
if (chdir(opts.dir)) {
+ /* If dchroot is executed from within a
+ * directory that does not exist in the chroot,
+ * the working directory is changed to / but
+ * the environment variables are still
+ * preserved. */
+ fprintf(stderr, PROGNAME ": could not change to
\"%s\" inside chroot.\n", opts.dir);
dchroot_perror("chdir");
- exit(EXIT_FAILURE);
+ chdir("/");
}
}
-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.10-9-amd64-k8
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1) (ignored: LC_ALL set to
de_DE)
Versions of packages dchroot depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]