From 08577e16e6c4aa38f8b3fd69b25662e6f1984667 Mon Sep 17 00:00:00 2001 From: hno <> Date: Thu, 9 Jan 2003 18:49:04 +0000 Subject: [PATCH] Bugzilla 493: chroot_dir messes up all path checks.. this patch makes life easier by assuming all paths are within the chroot directory.. --- src/cache_cf.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 6e27c4f841..61914b01cf 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.424 2002/12/27 10:26:33 robertc Exp $ + * $Id: cache_cf.cc,v 1.425 2003/01/09 11:49:04 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2534,9 +2534,14 @@ void requirePathnameExists(const char *name, const char *path) { struct stat sb; + char pathbuf[BUFSIZ]; assert(path != NULL); + if (Config.chroot_dir) { + snprintf(pathbuf, BUFSIZ, "%s/%s", Config.chroot_dir, path); + path = pathbuf; + } if (stat(path, &sb) < 0) - fatalf("%s: %s", path, xstrerror()); + fatalf("%s %s: %s", name, path, xstrerror()); } char * -- 2.47.3