FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 08-02-2010, 04:01 PM
Hans de Goede
 
Default 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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-02-2010, 04:27 PM
"Brian C. Lane"
 
Default 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
QvXaTs022tVaeYQNRKpzci3Ql8i85svssr39MsNsYkwCqh9dnV gPnfGRhNuofL5H
qm33jpSB10NUPWlZGwZ9NrOrcyartr84FhiOLyETeB1pJyORyC zN+WZbL8EoOqyT
BiZHn0RXmwQWynEGgdixTjU1mJkM20oVV66XylRz7LL6rnHmuY nWmo/lZ/vqVPJb
jTB0aJVeviYj/WZjr+DemtlIfURl0YnkE8xO0otxfjPDSc3Z0RybMVjTnVrVX4y h
v6IRaNW/8Mtzqc2HALylClh2GLi7D8SJJZj/3H+41i3T1c+IVPRAFA==
=83is
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:49 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org