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

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



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/02/2010 09:01 AM, Hans de Goede wrote:
> 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 {

Ack

- -- 
Brian C. Lane <bcl redhat com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Remember Lexington Green!

iQEVAwUBTFbx2hF+jBaO/jp/AQI0twf7BRxF8BVFu/JBUPE4NEVzHDChXUkNuoW2
QvXaTs022tVaeYQNRKpzci3Ql8i85svssr39MsNsYkwCqh9dnVgPnfGRhNuofL5H
qm33jpSB10NUPWlZGwZ9NrOrcyartr84FhiOLyETeB1pJyORyCzN+WZbL8EoOqyT
BiZHn0RXmwQWynEGgdixTjU1mJkM20oVV66XylRz7LL6rnHmuYnWmo/lZ/vqVPJb
jTB0aJVeviYj/WZjr+DemtlIfURl0YnkE8xO0otxfjPDSc3Z0RybMVjTnVrVX4yh
v6IRaNW/8Mtzqc2HALylClh2GLi7D8SJJZj/3H+41i3T1c+IVPRAFA==
=83is
-----END PGP SIGNATURE-----


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