History log of /netbsd-current/sbin/fsck_msdos/dir.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.29 28-Apr-2017 christos

Prevent SEGV on corrupted msdos directories (Veo Zhang)


Revision tags: prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.28 07-Mar-2016 christos

PR/50908: David Binderman: Optimize memset's


# 1.27 02-Jan-2015 mlelstv

Avoid mixing cluster numbers and sector numbers. Makes code more readable.


Revision tags: netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.26 07-Jul-2014 christos

From: http://marc.info/?t=140304310700005&r=1&w=2
When truncating cluster chains fix the length of the cluster head.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase
# 1.25 20-Feb-2011 christos

branches: 1.25.10; 1.25.20;
undo part of the previous patch, which I suspect is bad.


Revision tags: bouyer-quota2-base
# 1.24 07-Feb-2011 christos

PR/44529: Martin Danielsson: fsck_msdos crashes when verifying corrupt file
system. Avoid using the long name index when it is 0. Refactor the code to
avoid duplication.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.23 11-Apr-2009 lukem

branches: 1.23.2;
fix sign-compare issues


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base mjf-devfs2-base
# 1.22 13-Jun-2008 martin

branches: 1.22.4;
Move to 2 clause license, approved by Wolfgang Solfrank.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking cube-autoconf-base mjf-devfs-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.21 17-Jan-2007 hubertf

branches: 1.21.12; 1.21.14; 1.21.16;
Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.20 05-Jun-2006 christos

- don't leak memory on allocation failure.
- s/perror/perr and print how much we were trying to allocate.


# 1.19 10-Apr-2006 dbj

the root directory of non fat32 filesystems is stored in a special area.
a couple of corner cases can cause it to fail to write out that area
after it performs repairs.


# 1.18 20-Mar-2006 christos

Coverity CID 1078: Add assertion check for NULL pointer.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.17 19-Jan-2005 xtraeme

Kill __P(), ANSIfy, remove main() prototype.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.16 13-Jul-2003 itojun

use bounded string op


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.15 25-Apr-2000 jdolecek

Recognize "dirty" signature on FAT as set by Windows 95 OSR2+ and don't report
it just as "odd byte sequence". Handle the dirty flag similar way
it's treated on e.g. FFS - e.g. clear it separately from rest of FAT.
Changing of FAT is now postponed until after all checks are done,
check.c:checkfilesys() was cleaned considerably and several messages
has been adjusted to be more accurate.

If file system was modified and no error has occured, just return 0
instead of 4 - there is no need for forcing a reboot in this case.

This addresses bin/5638 by Christos Zoulas.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 25-Aug-1998 ross

from Erik Bertelsen <erik@mediator.uni-c.dk>
{ put } { in } { lots } { of } { these } { to } { shut } { up } { egcs }


# 1.13 28-Jul-1998 mycroft

__AUDIT__ cleanup.


# 1.12 22-Jan-1998 ws

Fix some bugs & annoyances when reparing defect disks


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.11 17-Oct-1997 ws

Add support for FAT32
Support dropping lost cluster chains (on request by Christoph Badura)
While being here, fix some minor bugs, mostly with format strings


# 1.10 14-Sep-1997 lukem

* cleanup for WARNS=1
* getopt returns -1 not EOF
* cleanup manpage


# 1.9 08-Sep-1997 ws

Fix a few bugs, especially when repairing disks:
Print correct pathname in error messages
Fix unterminating loop when trying to correct a bad fat
Require fat media byte to be the same as the one in the bpb
Fix unterminating loop when looking for free directory slot in LOST.DIR
(bad disk image provided by Christoph Badura)


# 1.8 27-Sep-1996 christos

util -> fsutil


# 1.7 24-Sep-1996 ws

Fix delete() call in dir.c differently than Christos' way.
Require at least one filesystem as program argument.
Update man page to reflect the latter.


# 1.6 23-Sep-1996 christos

- use error printing code from fsck(8)
- remove fstab walking code
- add missing prototypes
- add missing argument in dir.c near "Truncate", where delete() was being
called with fewer args. I think the missing argument should be a zero,
but Wolfgang should check...


# 1.5 17-Sep-1996 ws

Fix null pointer derefernce
Fixes PR#2765. Thanks David.


# 1.4 11-Sep-1996 christos

Fix gcc warnings.


# 1.3 28-May-1996 ws

Don't allocate data structures for non-directories
Free any data structures when finishing a check (at the latest)


# 1.2 25-May-1996 ws

Check return values of malloc
Generate full pathnames only on request
Minor cleanup, RCS Ids in .h files


Revision tags: netbsd-1-2-base
# 1.1 14-May-1996 ws

branches: 1.1.4;
Add fsck utility for msdosfs


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.28 07-Mar-2016 christos

PR/50908: David Binderman: Optimize memset's


# 1.27 02-Jan-2015 mlelstv

Avoid mixing cluster numbers and sector numbers. Makes code more readable.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.26 07-Jul-2014 christos

From: http://marc.info/?t=140304310700005&r=1&w=2
When truncating cluster chains fix the length of the cluster head.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase
# 1.25 20-Feb-2011 christos

branches: 1.25.10; 1.25.20;
undo part of the previous patch, which I suspect is bad.


Revision tags: bouyer-quota2-base
# 1.24 07-Feb-2011 christos

PR/44529: Martin Danielsson: fsck_msdos crashes when verifying corrupt file
system. Avoid using the long name index when it is 0. Refactor the code to
avoid duplication.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.23 11-Apr-2009 lukem

branches: 1.23.2;
fix sign-compare issues


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base mjf-devfs2-base
# 1.22 13-Jun-2008 martin

branches: 1.22.4;
Move to 2 clause license, approved by Wolfgang Solfrank.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking cube-autoconf-base mjf-devfs-base matt-armv6-base matt-mips64-base hpcarm-cleanup-base
# 1.21 17-Jan-2007 hubertf

branches: 1.21.12; 1.21.14; 1.21.16;
Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.20 05-Jun-2006 christos

- don't leak memory on allocation failure.
- s/perror/perr and print how much we were trying to allocate.


# 1.19 10-Apr-2006 dbj

the root directory of non fat32 filesystems is stored in a special area.
a couple of corner cases can cause it to fail to write out that area
after it performs repairs.


# 1.18 20-Mar-2006 christos

Coverity CID 1078: Add assertion check for NULL pointer.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.17 19-Jan-2005 xtraeme

Kill __P(), ANSIfy, remove main() prototype.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.16 13-Jul-2003 itojun

use bounded string op


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.15 25-Apr-2000 jdolecek

Recognize "dirty" signature on FAT as set by Windows 95 OSR2+ and don't report
it just as "odd byte sequence". Handle the dirty flag similar way
it's treated on e.g. FFS - e.g. clear it separately from rest of FAT.
Changing of FAT is now postponed until after all checks are done,
check.c:checkfilesys() was cleaned considerably and several messages
has been adjusted to be more accurate.

If file system was modified and no error has occured, just return 0
instead of 4 - there is no need for forcing a reboot in this case.

This addresses bin/5638 by Christos Zoulas.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.14 25-Aug-1998 ross

from Erik Bertelsen <erik@mediator.uni-c.dk>
{ put } { in } { lots } { of } { these } { to } { shut } { up } { egcs }


# 1.13 28-Jul-1998 mycroft

__AUDIT__ cleanup.


# 1.12 22-Jan-1998 ws

Fix some bugs & annoyances when reparing defect disks


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.11 17-Oct-1997 ws

Add support for FAT32
Support dropping lost cluster chains (on request by Christoph Badura)
While being here, fix some minor bugs, mostly with format strings


# 1.10 14-Sep-1997 lukem

* cleanup for WARNS=1
* getopt returns -1 not EOF
* cleanup manpage


# 1.9 08-Sep-1997 ws

Fix a few bugs, especially when repairing disks:
Print correct pathname in error messages
Fix unterminating loop when trying to correct a bad fat
Require fat media byte to be the same as the one in the bpb
Fix unterminating loop when looking for free directory slot in LOST.DIR
(bad disk image provided by Christoph Badura)


# 1.8 27-Sep-1996 christos

util -> fsutil


# 1.7 24-Sep-1996 ws

Fix delete() call in dir.c differently than Christos' way.
Require at least one filesystem as program argument.
Update man page to reflect the latter.


# 1.6 23-Sep-1996 christos

- use error printing code from fsck(8)
- remove fstab walking code
- add missing prototypes
- add missing argument in dir.c near "Truncate", where delete() was being
called with fewer args. I think the missing argument should be a zero,
but Wolfgang should check...


# 1.5 17-Sep-1996 ws

Fix null pointer derefernce
Fixes PR#2765. Thanks David.


# 1.4 11-Sep-1996 christos

Fix gcc warnings.


# 1.3 28-May-1996 ws

Don't allocate data structures for non-directories
Free any data structures when finishing a check (at the latest)


# 1.2 25-May-1996 ws

Check return values of malloc
Generate full pathnames only on request
Minor cleanup, RCS Ids in .h files


Revision tags: netbsd-1-2-base
# 1.1 14-May-1996 ws

branches: 1.1.4;
Add fsck utility for msdosfs