1 This patch must be applied to fakechroot 2.8 or SVN in order to
2 enable correct handling of relative chroots, for rpm and yum.
4 Note this patch has been included in upstreak fakechroot >= 2.9
6 Index: src/libfakechroot.c
7 ===================================================================
8 --- src/libfakechroot.c (revision 311)
9 +++ src/libfakechroot.c (working copy)
12 char *ptr, *ld_library_path, *tmp, *fakechroot_path;
14 - char dir[FAKECHROOT_MAXPATH], cwd[FAKECHROOT_MAXPATH], full_path[FAKECHROOT_MAXPATH];
15 + char dir[FAKECHROOT_MAXPATH], cwd[FAKECHROOT_MAXPATH];
16 #if !defined(HAVE_SETENV)
23 - if (getcwd(cwd, FAKECHROOT_MAXPATH) == NULL) {
24 + if (next_getcwd == NULL) fakechroot_init();
26 + if (next_getcwd(cwd, FAKECHROOT_MAXPATH) == NULL) {
30 @@ -1171,24 +1173,22 @@
33 if (strcmp(cwd, "/") == 0) {
34 - snprintf(full_path, FAKECHROOT_MAXPATH, "/%s", path);
35 + snprintf(dir, FAKECHROOT_MAXPATH, "/%s", path);
38 - snprintf(full_path, FAKECHROOT_MAXPATH, "%s/%s", cwd, path);
39 + snprintf(dir, FAKECHROOT_MAXPATH, "%s/%s", cwd, path);
43 - snprintf(full_path, FAKECHROOT_MAXPATH, "%s", path);
45 + fakechroot_path = getenv("FAKECHROOT_BASE");
47 - fakechroot_path = getenv("FAKECHROOT_BASE");
49 - if (fakechroot_path != NULL) {
50 - snprintf(dir, FAKECHROOT_MAXPATH, "%s%s", fakechroot_path, full_path);
51 + if (fakechroot_path != NULL) {
52 + snprintf(dir, FAKECHROOT_MAXPATH, "%s%s", fakechroot_path, path);
55 + snprintf(dir, FAKECHROOT_MAXPATH, "%s", path);
59 - snprintf(dir, FAKECHROOT_MAXPATH, "%s", full_path);
62 #if defined(HAVE___XSTAT) && defined(_STAT_VER)
63 if ((status = next___xstat(_STAT_VER, dir, &sb)) != 0) {