[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2] shutdown: Use lstat to test for /lib64



When deciding if we need to mv /lib64_old to /lib64 or /lib_old to /lib
after unmounting /mnt/runtime, lstat must be used as /lib64 if present
is a link to a no longer existing dir, so using regular stat to test for
/lib64 will fail as regulat stat follows links.

Related: rhbz#604614
---
 loader/shutdown.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/loader/shutdown.c b/loader/shutdown.c
index cc8a85f..b360777 100644
--- a/loader/shutdown.c
+++ b/loader/shutdown.c
@@ -62,7 +62,7 @@ static void performUnmounts(void) {
 
 	/* We've lost /mnt/runtime where /lib is a link to put the old
 	   /lib back so that our mdadm invocation below works. */
-	if (stat("/lib64", &st_buf) == 0) {
+	if (lstat("/lib64", &st_buf) == 0) {
 		unlink("/lib64");
 		rename("/lib64_old", "/lib64");
 	} else {
-- 
1.7.0.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]