[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: statuscheck patch..
From: |
B.Hakvoort |
Subject: |
Re: statuscheck patch.. |
Date: |
Wed, 18 Aug 2004 20:37:35 +0200 |
Hey Tal,
You're right about this one, but it didn't seem a real problem to me,
but maybe i'm wrong.
Anyway, i implemented the _mounted_search function to take a filename as
argument as well, so it's easy to extend the check with an extra
filename (/proc/mounts in this case)
A typical check looks like this:
status = _mounted_search( "/etc/mtab", major, minor ) ;
replacing the file or adding more checks could increase changes on
succes. If you want to be real thorough it may be wise to check
/etc/mtab AND /proc/mounts ( and don't forget the /proc/swaps ;) )
It could look like this:
.........................................................
status = _mounted_search( "/proc/mounts", major, minor ) ;
if ( ! status )
status = _mounted_search( "/etc/mtab", major, minor ) ;
if ( ! status )
status = _mounted_search( "/proc/swaps", major, minor ) ;
return status;
............................................................
quite paranoia, but thorough :)
Regards,
Bart
On Wed, 2004-08-18 at 20:27, Tal Danzig wrote:
> * On Tue Aug 17, 2004 17:16:11 +0200, B.Hakvoort wrote:
> > Hi,
> >
> > found some time and implemented the check as we discussed it. It surely
> > cuts codesize! ;)
> >
> > The main check is done in /etc/mtab instead of /proc/mounts, this is
> > because /etc/mtab contains real ( or followable ) names, while
> > /proc/mounts can be quite cryptic. I have collected a few mtab files
> > from different configs and haven't found any problem thusfar.
> > NOTE: rootdevice is included in this check!
>
> One problem with this approach is that /etc/mtab may not be up-to-date
> (think read-only file system) while /proc/mounts always contains a full
> list of what is mounted. Also, on some systems /etc/mtab is a symlink
> to /proc/mounts.
>
> - Tal
--
www.titanium-it.nl --- Open Minded Open Source
www.real-life.nl <-----Another Source