Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16339 - checkroot does not do full fsck when fsck -a cannot fix the filesystem
Summary: checkroot does not do full fsck when fsck -a cannot fix the filesystem
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Highest blocker (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-25 01:56 UTC by Ross Cartlidge
Modified: 2003-02-26 02:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Cartlidge 2003-02-25 01:56:45 UTC
/etc/init.d/checkroot - from baselayout-1.8.5.8
does a "fsck -a" and then uses "$?" in a [..] and
then uses it again. This means that if fsck returns "4" and
the first comparison with "0" sets "$?" to 1 and then the camparison
with "1" succeeds.

Here is a patch:-

*** checkroot   Tue Feb 25 17:55:41 2003
--- checkroot.orig      Sun Feb  2 10:31:03 2003
***************
*** 25,35 ****
                else
                        fsck -a /
                fi
!               rc=$?
!               if [ $rc -eq 0 ]
                then
                        eend 0
!               elif [ $rc -eq 1 ]
                then
                        ewend 1 "Filesystem repaired"
                else
--- 25,34 ----
                else
                        fsck -a /
                fi
!               if [ "$?" -eq 0 ]
                then
                        eend 0
!               elif [ "$?" -eq 1 ]
                then
                        ewend 1 "Filesystem repaired"
                else
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-26 02:29:36 UTC
Already fixed, will be in next official release:

-----------------------------------
  26 Jan 2003; Martin Schlemmer <azarah@gentoo.org>:

    Fix start-stop-daemon to check the call to nice() correctly for failure,
    closing bug #14359, thanks to YAMAKURA Makoto <makoto@dsb.club.ne.jp>.

    Fix globbing $? when checking return value of fsck in /etc/init.d/checkroot
    and /etc/init.d/checkfs.  This closes bug #13320, thanks to good work from
    Malcolm Scott <m@lcolm.org.uk>.