OpenBSD CVS

CVS log for src/sbin/restore/tape.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.54 / (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.53: +25 -6 lines
Diff to previous 1.53 (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.53 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:07 2023 UTC (15 months ago) by guenther
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
Changes since 1.52: +1 -5 lines
Diff to previous 1.52 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.52 / (download) - annotate - [select for diffs], Thu Jan 21 00:16:36 2021 UTC (3 years, 4 months ago) by mortimer
Branch: MAIN
CVS Tags: 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
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

Rearrange variables in dump / restore to handle -fno-common.

Largely following the commit by mckusick in FreeBSD.

ok naddy@

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:46 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.50: +7 -7 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Fri Apr 27 06:46:04 2018 UTC (6 years, 1 month ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored)

Restore mode on symlinks

ok deraadt@

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jan 21 08:31:44 2017 UTC (7 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.48: +25 -25 lines
Diff to previous 1.48 (colored)

Nuke whitespace foolish enough to expose itself during the great
"warning:" rectification.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Dec 26 23:43:52 2016 UTC (7 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

Put some variable declarations under appropriate #if/#endif protection
so gcc doesn't complain about defining but not using them.

typo correction & ok jca@

Revision 1.47 / (download) - annotate - [select for diffs], Thu Dec 10 17:27:00 2015 UTC (8 years, 6 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.46: +2 -3 lines
Diff to previous 1.46 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Aug 25 04:18:43 2015 UTC (8 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.45: +12 -12 lines
Diff to previous 1.45 (colored)

Switch from utimes() to utimensat() to $estore full nanosecond granularity

ok millert@ deraadt@

Revision 1.45 / (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_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.44: +5 -4 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Sun Sep 7 19:43:35 2014 UTC (9 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.43: +2 -3 lines
Diff to previous 1.43 (colored)

Reuse xtrfile() to avoid duplication.
Casting from long to int for a size_t argument is dumb.
Calling warnx() right before err() is silly.

ok millert@

Revision 1.43 / (download) - annotate - [select for diffs], Wed Sep 3 02:37:24 2014 UTC (9 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Mark msg() and panic() as printf-like and fix the format error it turns up

ok krw@

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jul 21 01:51:11 2014 UTC (9 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>

ok deraadt@ millert@ beck@

Revision 1.41 / (download) - annotate - [select for diffs], Wed Apr 24 13:46:29 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.40: +17 -15 lines
Diff to previous 1.40 (colored)

pretty print bigger off_t
ok tedu otto

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jul 14 08:58:18 2012 UTC (11 years, 11 months ago) by halex
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

replace (somewhat) magic numbers with constants

ok krw@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jun 27 23:40:57 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.38: +8 -8 lines
Diff to previous 1.38 (colored)

remove some useless casts. ok krw

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:34 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.37: +1 -9 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Wed Sep 3 23:11:59 2008 UTC (15 years, 9 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.36: +4 -3 lines
Diff to previous 1.36 (colored)

Start with a max size tape buffer rather than one 1/2 the max (i.e.
32K). This allows the automatic recognition of dumps written with
64K buffers. It also prevents alert scsi devices from complaining
about read requests that provide only 1/2 the room needed for an
actual tape record.

Problem noted, fix tested & ok henning@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Sep 25 09:55:33 2007 UTC (16 years, 8 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (colored)

remove unneeded feof

with help and ok ray@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Sep 13 09:19:56 2007 UTC (16 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.34: +9 -8 lines
Diff to previous 1.34 (colored)

use strcspn to properly overwrite '\n' in fgets returned buffer
use strtonum instead of atoi

prompted by ray@
ok moritz@ ray@

Revision 1.34 / (download) - annotate - [select for diffs], Fri Sep 7 16:30:25 2007 UTC (16 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.33: +8 -10 lines
Diff to previous 1.33 (colored)

check fgets return value
use sizeof buf instead of TP_BSIZE
use strcspn to properly overwrite '\n' in fgets returned buffer

ok moritz@ ray@

Revision 1.33 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:25 2007 UTC (16 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jun 3 20:16:08 2007 UTC (17 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.31: +198 -133 lines
Diff to previous 1.31 (colored)

Add ffs2 support to dump/restore.  From FreeBSD with some NetBSD changes.
With help from otto@

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jun 14 19:46:05 2005 UTC (19 years ago) by millert
Branch: MAIN
CVS Tags: 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
Changes since 1.30: +2 -9 lines
Diff to previous 1.30 (colored)

Kill whiteout support.  OK deraadt@ and beck@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Dec 30 01:51:32 2004 UTC (19 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.29: +43 -73 lines
Diff to previous 1.29 (colored)

Replace home-grown byte swapping routine with calls to swap* macros
from endian.h.  Header swapping is moved into its own function.
Fixes problems reading non-native endian dump images on sparc64.
Adapted from changes in NetBSD.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 17 02:14:33 2004 UTC (19 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.28: +31 -62 lines
Diff to previous 1.28 (colored)

some ansi; khalek@linuxgamers.net

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 13 21:51:18 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.27: +29 -29 lines
Diff to previous 1.27 (colored)

fix restore so that it can actually restore files larger than 4GB by
changing the type of "size" to off_t in getfiles() plus little dependent
type cleanup, from Daniel Lucq <daniel@lucq.org>
ok tdeval@ millert@ otto@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jul 29 18:38:36 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

spaces

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jul 28 06:13:26 2003 UTC (20 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

rcsid should say openbsd.  make 'em const while here.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jun 19 03:49:44 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.24: +7 -5 lines
Diff to previous 1.24 (colored)

Strip the newline from the buffer when reading the tape name during
tape change.  Closes PR 3324; OK krw@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jun 2 20:06:16 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.23: +2 -6 lines
Diff to previous 1.23 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Apr 6 13:29:41 2003 UTC (21 years, 2 months ago) by avsm
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

strcat->strlcat, ho@ ok

Revision 1.22 / (download) - annotate - [select for diffs], Thu Mar 13 05:00:44 2003 UTC (21 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.21: +7 -8 lines
Diff to previous 1.21 (colored)

more strlcpy; most from Hans-Joerg.Hoexer@yerbouti.franken.de, a bit from me

Revision 1.21 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:38 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.20: +2 -15 lines
Diff to previous 1.20 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:37 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.19: +20 -20 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Mon Nov 5 07:39:17 2001 UTC (22 years, 7 months ago) by mpech
Branch: MAIN
Changes since 1.18: +10 -10 lines
Diff to previous 1.18 (colored)

kill more registers;

millert@ ok

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

major -Wall cleanup, almost complete

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jan 9 03:26:06 2001 UTC (23 years, 5 months ago) by angelos
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.16: +19 -6 lines
Diff to previous 1.16 (colored)

Don't skip if TS_BITS or TS_CLRI, closed PR 1576. Fix supplied by
sysadmin@astro.su.se

Revision 1.16 / (download) - annotate - [select for diffs], Thu Sep 14 22:38:19 2000 UTC (23 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

wrong type to ioctl; naddy@mips.inka.de

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jun 16 16:43:18 2000 UTC (24 years ago) by deraadt
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

use TP_BSIZE (== BUFSIZ so no problem)

Revision 1.14 / (download) - annotate - [select for diffs], Tue Aug 17 09:13:15 1999 UTC (24 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

More <sys/file.h> vs. <fcntl.h> and open() flags fixes.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Feb 17 00:07:52 1998 UTC (26 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

chflags(2) take a u_int

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 10 20:20:03 1998 UTC (26 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +3 -1 lines
Diff to previous 1.11 (colored)

allow tape blocksize > disk blocksize to work; dwmalone@maths.tcd.ie

Revision 1.11 / (download) - annotate - [select for diffs], Sun Aug 24 08:07:23 1997 UTC (26 years, 9 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

More err()/warn()/etc. argument fixes.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 25 19:13:13 1997 UTC (26 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

#if __STDC__ --> #ifdef __STDC__

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 5 20:51:26 1997 UTC (26 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.8: +99 -139 lines
Diff to previous 1.8 (colored)

vprintf -> Vprintf and dprintf -> Dprintf to avoid confusion
Use err/errx and warn/warnx where it makes sense.
Some sprintf -> snprintf, strcpy -> strncpy, and strcat -> strncat.
Honor $TMPDIR (based on changes from NetBSD)
Use __progname not "restore" (we could be called as rrestore).
Some -Wall happiness.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Apr 16 04:07:40 1997 UTC (27 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

No need for "pathnames.h" now that _PATH_DEFTAPE is in <paths.h>
Fix rmt -> rst in man page and change ".Nm restore" -> ".Nm"

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 27 09:33:08 1997 UTC (27 years, 4 months ago) by downsj
Branch: MAIN
Changes since 1.6: +18 -9 lines
Diff to previous 1.6 (colored)

Support lchown(2).

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 27 09:48:07 1996 UTC (27 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

epilepsy in csrg?

Revision 1.5 / (download) - annotate - [select for diffs], Wed Dec 11 19:23:40 1996 UTC (27 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

from netbsd; repair byte swapping of fields

Revision 1.4 / (download) - annotate - [select for diffs], Wed Dec 4 01:41:54 1996 UTC (27 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +22 -22 lines
Diff to previous 1.3 (colored)

64 bit patches, tih@nhh.no

Revision 1.3 / (download) - annotate - [select for diffs], Sun Sep 1 15:27:29 1996 UTC (27 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +1 -5 lines
Diff to previous 1.2 (colored)

lose setuid

Revision 1.2 / (download) - annotate - [select for diffs], Thu Mar 21 00:16:32 1996 UTC (28 years, 2 months ago) by niklas
Branch: MAIN
Changes since 1.1: +7 -3 lines
Diff to previous 1.1 (colored)

From NetBSD: Merge of 960317

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:43:47 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:43:47 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN

Initial revision

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.