OpenBSD CVS

CVS log for src/sbin/newfs_msdos/newfs_msdos.c


[BACK] Up to [local] / src / sbin / newfs_msdos

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Sun Apr 28 16:43:42 2024 UTC (5 weeks, 5 days ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.28: +4 -2 lines
Diff to previous 1.28 (colored)

gmtime(3) / locatime(3) can fail when timestamps are way off.

Add missing error checks to all calls under sbin/

Input & OK millert

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jul 11 15:39:58 2021 UTC (2 years, 10 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.27: +6 -6 lines
Diff to previous 1.27 (colored)

Correct various min/max cluster numbers for FAT12/16/32.  From NetBSD.

ok krw@, jsg@

Revision 1.27 / (download) - annotate - [select for diffs], Mon Nov 23 19:19:30 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.26: +4 -1 lines
Diff to previous 1.26 (colored)

Use pledge "disklabel" as needed.  The theory here is these tools become more
resistant against memory correctup, if a corrupt filesystem is given to them.
ok krw

Revision 1.26 / (download) - annotate - [select for diffs], Sat Apr 18 18:28:37 2015 UTC (9 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.25: +3 -5 lines
Diff to previous 1.25 (colored)

Convert many atoi() calls to strtonum(), adding range checks and failure
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:00 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.24: +9 -5 lines
Diff to previous 1.24 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jul 10 20:09:53 2014 UTC (9 years, 11 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

Not initializing "next free cluster" is better than pointing at a cluster
that is in use.

Merged from NetBSD rev 1.9.

ok krw@ (who came up with the same diff)

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jul 10 19:31:07 2014 UTC (9 years, 11 months ago) by tobias
Branch: MAIN
Changes since 1.22: +7 -7 lines
Diff to previous 1.22 (colored)

Put boot signature always at end of 512 byte sector, even on disks with
larger sector sizes.  512 bytes is also the smallest valid sector size.

Merged from NetBSD's revision 1.24.

ok krw@, tedu@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 22 04:14:01 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Whole bunch of (unsigned char) casts carefully added for ctype calls.
Careful second audit by millert

Revision 1.21 / (download) - annotate - [select for diffs], Tue Nov 5 00:51:58 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

Replace direct references to p_size, p_offset and d_secperunit with
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in
order to get|set correct value that includes the high bits of the
value.

Revision 1.20 / (download) - annotate - [select for diffs], Tue May 18 04:41:14 2010 UTC (14 years ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

dont let sys/ioctl.h imply that you get the ioctls in dkio.h. this
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include
<sys/dkio.h> to the places that actually want and use the disk
ioctls.

this became an issue when krw@'s X build failed when he was testing
a change to dkio.h.
tested by krw@
help from and ok miod@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:33 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.18: +1 -6 lines
Diff to previous 1.18 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jul 27 18:11:07 2009 UTC (14 years, 10 months ago) by halex
Branch: MAIN
Changes since 1.17: +3 -1 lines
Diff to previous 1.17 (colored)

As is already the case for ffs, do not allow creation of msdos file systems
on block devices

ok marco@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Sep 28 09:57:01 2007 UTC (16 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.16: +7 -6 lines
Diff to previous 1.16 (colored)

sort options;

Revision 1.16 / (download) - annotate - [select for diffs], Wed Sep 26 18:49:03 2007 UTC (16 years, 8 months ago) by pyr
Branch: MAIN
Changes since 1.15: +13 -137 lines
Diff to previous 1.15 (colored)

some cleanup. remove #ifdef __FreeBSD__ code, last sync to FreeBSD was
7 years ago. this improves readability.
provide a standard usage message while there (synced with manpage).
ok millert@, ``looks fine'' krw@.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Oct 1 04:08:45 2004 UTC (19 years, 8 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.14: +2 -0 lines
Diff to previous 1.14 (colored)

add some missing $, ok djm@ 'That looks fine to me' millert@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jun 10 16:41:29 2003 UTC (21 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

boring cleanups

Revision 1.13 / (download) - annotate - [select for diffs], Wed May 29 09:19:52 2002 UTC (22 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.12: +1 -1 lines
Diff to previous 1.12 (colored)

more snprintf

Revision 1.12 / (download) - annotate - [select for diffs], Thu Feb 21 07:32:55 2002 UTC (22 years, 3 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.11: +1 -1 lines
Diff to previous 1.11 (colored)

use sizeof w/ defines; niklas@ millert@ ok.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jul 7 18:26:17 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.10: +4 -3 lines
Diff to previous 1.10 (colored)

major -Wall cleanup, almost complete

Revision 1.10 / (download) - annotate - [select for diffs], Sun Feb 6 22:52:13 2000 UTC (24 years, 4 months ago) by imp
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.9: +952 -292 lines
Diff to previous 1.9 (colored)

Upgrade newfs_msdos to latest freebsd version.  This one knows how to handle
msdos on hard disk as well as floppies.  ok millert@

Revision 1.9 / (download) - annotate - [select for diffs], Sat Apr 10 04:22:46 1999 UTC (25 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

ignore -q for now since we are already quiet.  Makes "newfs -q -t msdos" does not generate an error

Revision 1.8 / (download) - annotate - [select for diffs], Wed Apr 30 13:51:51 1997 UTC (27 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.7: +1 -4 lines
Diff to previous 1.7 (colored)

clone boot sector that existed there? bad idea. No idea why though

Revision 1.7 / (download) - annotate - [select for diffs], Mon Apr 14 12:07:04 1997 UTC (27 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +48 -10 lines
Diff to previous 1.6 (colored)

if -s not specified, attempt to grok the disklabel

Revision 1.6 / (download) - annotate - [select for diffs], Sat Mar 29 20:01:26 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

Use arc4random() not random().

Revision 1.5 / (download) - annotate - [select for diffs], Sat Mar 22 02:51:06 1997 UTC (27 years, 2 months ago) by kstailey
Branch: MAIN
Changes since 1.4: +1 -6 lines
Diff to previous 1.4 (colored)

removed code that was inside #if 0 ... #endif

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jan 15 23:41:32 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

getopt(3) returns -1 when out of args, not EOF, whee!

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jan 10 19:04:10 1997 UTC (27 years, 5 months ago) by kstailey
Branch: MAIN
Changes since 1.2: +8 -1 lines
Diff to previous 1.2 (colored)

use opendev(3) + man page correction

Revision 1.2 / (download) - annotate - [select for diffs], Wed Dec 4 08:33:58 1996 UTC (27 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (colored)

do not freak out if we see a -t argument

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 10 06:37:16 1996 UTC (28 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0

add newfs_msdos (from freebsd); does not know how to make non-floppy filesystems yet

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.