OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.44 / (download) - annotate - [select for diffs], Thu May 9 08:35:40 2024 UTC (4 weeks, 4 days ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.43: +8 -3 lines
Diff to previous 1.43 (colored)

ctime(3) and ctime_r(3) can fail when timestamps are way off.
Add missing error checks to all calls under sbin/

Input kettenis, millert
OK millert

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jun 20 07:49:04 2020 UTC (3 years, 11 months ago) by otto
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, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

With filesystem having many cylinder groups and many inodes per cg the
ncg * ipg calcualtion can overflow if signed types are used.  Move
to uint32_t for the relevant values. Aligned with FreeBSD changes.
Also make sure newfs refuses to create an fs with more that 2^32-1
inodes.  ok millert@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Feb 17 19:00:58 2020 UTC (4 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.41: +10 -1 lines
Diff to previous 1.41 (colored)

Do not look for an FFS1 file system at SBLOCK_UFS2.  Doing so will
find the wrong super-block for file systems with 64k block size.
ok visa@

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:43 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.40: +8 -8 lines
Diff to previous 1.40 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jan 25 00:19:26 2019 UTC (5 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

I am retiring my old email address;  replace it with my OpenBSD one.

Revision 1.39 / (download) - annotate - [select for diffs], Sun Aug 14 22:35:54 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
CVS Tags: 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
Changes since 1.38: +21 -20 lines
Diff to previous 1.38 (colored)

Convert %q to %ll.  Cast off_t to long long for printf-style args.
Eliminate pointless casts to void* or off_t

ok krw@

Revision 1.38 / (download) - annotate - [select for diffs], Sat May 28 17:16:39 2016 UTC (8 years ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.37: +1 -4 lines
Diff to previous 1.37 (colored)

Fix a pledge abort that can be triggered by using DIOCGDINFO on a file
that is not a disk device (e.g. fsirand -p /altroot) by removing the
first of the two pledges.  The program then runs with pledge "stdio"
right after the ioctl.

ok deraadt

Revision 1.37 / (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_5_9_BASE, OPENBSD_5_9
Changes since 1.36: +3 -0 lines
Diff to previous 1.36 (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.36 / (download) - annotate - [select for diffs], Wed Nov 18 15:36:32 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

opendev() should not use OPENDEV_PART; ok millert

Revision 1.35 / (download) - annotate - [select for diffs], Sun Oct 11 04:37:23 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

After the filesystem is opened, pledge "stdio"
ok doug

Revision 1.34 / (download) - annotate - [select for diffs], Fri Mar 20 01:53:05 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Fix cut & pasto in warning message; from Andre Smagin

Revision 1.33 / (download) - annotate - [select for diffs], Sat Feb 7 02:09:13 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

When getopt processing flags, many should be flag=1 instead of flag++
ok tedu miod

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jan 20 18:22:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Adjust <sys/param.h> comments regarding use of use of MAXFRAG, or
delete <sys/param.h> if now possible
ok guenther

Revision 1.31 / (download) - annotate - [select for diffs], Fri Jan 16 06:39:58 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +2 -3 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Sat Oct 11 03:48:49 2014 UTC (9 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.29: +10 -14 lines
Diff to previous 1.29 (colored)

slightly more complicated reallocarray conversion.  always realloc* rather
than the silly test which realloc* does itself, and massage the inode
sizes more carefully
ok doug

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jun 11 16:42:04 2013 UTC (11 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

final removal of daddr64_t.  daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 23 17:29:14 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.27: +3 -2 lines
Diff to previous 1.27 (colored)

handle big ino_t
ok otto

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 2 04:16:39 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +5 -3 lines
Diff to previous 1.26 (colored)

handle time_t which is not u_int32_t
ok guenther

Revision 1.26 / (download) - annotate - [select for diffs], Tue May 18 04:41:14 2010 UTC (14 years ago) by dlg
Branch: MAIN
CVS Tags: 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.25: +2 -1 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Fri Jun 1 06:41:35 2007 UTC (17 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, 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, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

convert ufs2_daddr_t -> daddr64_t for greater clarity; ok pedro otto thib

Revision 1.24 / (download) - annotate - [select for diffs], Mon Mar 19 13:30:55 2007 UTC (17 years, 2 months ago) by pedro
Branch: MAIN
Changes since 1.23: +58 -23 lines
Diff to previous 1.23 (colored)

Bits to make fsirand grok FFS2, okay millert@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 20 13:55:17 2007 UTC (17 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

simplify synopsis and usage(); from Igor Sobrado

Revision 1.22 / (download) - annotate - [select for diffs], Tue Sep 14 22:11:35 2004 UTC (19 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: 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.21: +3 -4 lines
Diff to previous 1.21 (colored)

remove unused variable

Revision 1.21 / (download) - annotate - [select for diffs], Sun Aug 8 19:04:25 2004 UTC (19 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

spacing

Revision 1.20 / (download) - annotate - [select for diffs], Wed Sep 24 20:40:19 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

realloc fixes; ok ho

Revision 1.19 / (download) - annotate - [select for diffs], Mon Aug 25 23:28:15 2003 UTC (20 years, 9 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

rename struct dinode to ufs1_dinode.  clears the namespace and makes
way for some future work.  no function changes yet.
help testing otto@ and markus@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jun 17 21:56:24 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.17: +9 -9 lines
Diff to previous 1.17 (colored)

Sync with share/misc/license.template and add missing DARPA credit
where applicable.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jun 3 01:52:40 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.16: +12 -23 lines
Diff to previous 1.16 (colored)

Use an ISC-tyle license for all my code; it is simpler and more permissive.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jul 3 22:32:32 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.15: +16 -18 lines
Diff to previous 1.15 (colored)

ansi

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jun 9 08:13:06 2002 UTC (22 years ago) by todd
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored)

rm trailing whitespace

Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:35 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jun 21 22:13:55 1998 UTC (25 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.12: +3 -6 lines
Diff to previous 1.12 (colored)

Remove the advertising clause in my old license, it impedes free use
of the code as a large number of similar clauses makes it impossible
to write an ad for a product using the code...

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jan 22 05:36:10 1998 UTC (26 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.11: +7 -8 lines
Diff to previous 1.11 (colored)

Fix backup sblock sanity checking for real.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jan 22 05:13:18 1998 UTC (26 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.10: +5 -5 lines
Diff to previous 1.10 (colored)

Fix sanity check of backup sblocks as well as error message.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Aug 11 02:52:31 1997 UTC (26 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.9: +8 -8 lines
Diff to previous 1.9 (colored)

Add extra off_t casts for paranoia and because I don't have a large
filesystem to prove that it is *not* necesary.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Feb 28 00:46:33 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.8: +9 -8 lines
Diff to previous 1.8 (colored)

Slightly more sane rlimit usage.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Feb 22 06:46:23 1997 UTC (27 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.7: +11 -2 lines
Diff to previous 1.7 (colored)

Use rlimit to set datasize to max.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 11 06:59:25 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.6: +2 -6 lines
Diff to previous 1.6 (colored)

We now has fs_id in struct fs.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 9 06:41:08 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.5: +10 -10 lines
Diff to previous 1.5 (colored)

Fix casts to off_t, problem noted and fixed by Theo.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 9 01:10:17 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.4: +145 -42 lines
Diff to previous 1.4 (colored)

Get block size from disklabel.
Adds support for setting fs_id for when when we have that in struct fs.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jan 28 04:21:25 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Only print the partition if doing multiple devices.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jan 28 04:14:55 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.2: +68 -73 lines
Diff to previous 1.2 (colored)

Revert back to old fsirand but do things a cylinder group at a time
and allow multiple devices.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jan 27 23:21:57 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.1: +67 -32 lines
Diff to previous 1.1 (colored)

Faster fsirand based in part on code from fsck_ffs.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jan 26 02:23:23 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN

ffs inode randomizer

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.