Kaynağa Gözat

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/`

Mike Frysinger 17 yıl önce
ebeveyn
işleme
63f1972009
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1 0
      utils/ldconfig.c

+ 1 - 0
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));