From 63f197200999f71193f5a57be8be0e289cd7dde1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 17 Apr 2007 23:08:20 +0000 Subject: if chroot() failed, then reset "chroot_dir" to "." so that after we do our fallback chdir(), we dont continue to prefix the chroot path ... fixes `ldconfig.host -r some/dir/` --- utils/ldconfig.c | 1 + 1 file changed, 1 insertion(+) (limited to 'utils') diff --git a/utils/ldconfig.c b/utils/ldconfig.c index a5d3ce67c..0abd0613e 100644 --- a/utils/ldconfig.c +++ b/utils/ldconfig.c @@ -918,6 +918,7 @@ int main(int argc, char **argv) if (chroot(chroot_dir) < 0) { if (chdir(chroot_dir) < 0) err(EXIT_FATAL, "couldn't chroot to %s (%s)", chroot_dir, strerror(errno)); + chroot_dir = "."; } else { if (chdir("/") < 0) err(EXIT_FATAL, "couldn't chdir to / (%s)", strerror(errno)); -- cgit v1.2.3