Commit Graph

186 Commits

Author SHA1 Message Date
Diomidis Spinellis
aa590d16d0 Remove a diagnostic message that can't occur: we lost the ability to
handle the old filesystem format on 2002/06/21.
2005-10-20 11:20:55 +00:00
Diomidis Spinellis
153fdc98cf Interpret correctly the glob(3) return value.
Previously, interactive commands specifying a non-existent file or
directory used to display an "out of memory error".

MFC after:	2 weeks
2005-07-21 16:12:35 +00:00
Philippe Charnier
35a974fdb8 rscid -> __FBSDID. Mark parameter as __unused when necessary. 2005-05-29 15:57:00 +00:00
Warner Losh
371c9f9384 Remove debug from last commit 2005-04-03 16:35:58 +00:00
Warner Losh
64a96794b7 /*- 2005-04-03 05:18:28 +00:00
Warner Losh
aad0ac34fe Revert bogus += -g change. I needed it to debug the problem.
Noticed by: njl, Andrej Tobola
2005-03-25 17:30:20 +00:00
Warner Losh
66b4217151 Restore the ability to read FreeBSD 1 tapes (and I think any net2
based tapes, but I'm not sure where NFS_MAGIC was introduced after
4.3).  When support for the pre-4.4 format was removed (the ability to
read 4.2 and 4.3 BSD tapes), the old format inode conversion was
junked as well.  However, FreeBSD 1 dump tapes use the NFS_MAGIC
format, but have this inode format.  Before, restore would fail
complaining that '.' wasn't found and the root directory wasn't on
this tape.  Since the conversion from the not so old format is
relatively trivial, restore the code to make that conversion.

FreeBSD 1 dumps are once again readable.

MFC After: a few days
2005-03-25 07:35:59 +00:00
Warner Losh
a2c0855654 dcvt is unused since the support for converting pre-4.4 tapes was
removed.  Go ahead and remove it and struct odirent since it too is
unused.

# FreeBSD 1.1.5 tapes are still unreadable, but 2.0 and newer work.
2005-03-25 06:57:50 +00:00
Warner Losh
84c248f850 c_tapea and c_firstrec are used for TS_TAPE blocks, so convert them
for the old (4.4-lite through FreeBSD 4.x and *BSD) format.  It looks
like they aren't used for TS_INODE, but conversion costs so little
there that I've not removed them there (in case my grep was wrong).

This makes at least some of the tapes work for me again.  Now, to
regresion test all my dusty tapes...
2005-03-25 06:03:11 +00:00
Warner Losh
372e256ad0 In order to print out the dump dates correctly, the date and ddate fields
also need to be convereted for old tapes for records of type TAPE.
2005-03-18 21:06:54 +00:00
Warner Losh
ecdd99f852 Sync usage and man page with reality. There's no '-c' command line
flag today.  Maybe we should still retain it, but I'll let others fight
that windmill.
2005-03-18 17:49:08 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
8d646af581 Sync program's usage() with manpage's SYNOPSIS. 2005-02-10 09:19:34 +00:00
Ruslan Ermilov
6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Ruslan Ermilov
9806e23132 Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
Stefan Farfeleder
1916772e6f Use the correct types for the functions rst_opendir(), glob_readdir() and
rst_closedir() which are called by glob().

Reviewed by:	md5
Approved by:	das (mentor)
2004-05-24 16:24:26 +00:00
Stefan Farfeleder
e54fb3f2dc Include <timeconv.h> for time conversion functions.
Approved by:	das (mentor)
2004-05-24 16:10:57 +00:00
Ruslan Ermilov
d04b5dfe6c Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
Brian Feldman
c51d70c690 Add -P arguments for dump(8) and restore(8) which allow the user to
use backup methods other than files and tapes.  The -P argument is
a normal sh(1) pipeline with either $DUMP_VOLUME or $RESTORE_VOLUME
defined in the environment, respectively.

For example, I can back up my home to three DVD+R[W]s as so:
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/ad0s2e  40028550 10093140 26733126    27%    /home
green# dump -0 -L -C16 -B4589840 -P 'growisofs -Z /dev/cd0=/dev/fd/0' /home
2004-04-13 02:58:06 +00:00
Mark Murray
4c723140a4 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
Johan Karlsson
604d24db95 style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
Peter Wemm
30d38f7b0d Fix gcc warnings. If NAME_MAX is 255, and d_namlen is a uint8_t, then
d_namlen can never be > NAME_MAX.  Stop gcc worrying about this by
using a preprocessor test to see if NAME_MAX changes.
2003-10-26 04:43:02 +00:00
Andrey A. Chernov
0407880f4b Localize 'ls' output
Don't set 8bit in quote processing
2003-08-06 08:46:21 +00:00
Philippe Charnier
9680d7b695 Add section number to .Xr 2003-06-08 12:51:28 +00:00
Ruslan Ermilov
44b81f0f89 Removed all vestiges of KerberosIV. 2003-05-01 21:18:36 +00:00
Ruslan Ermilov
cbfe6d117c Style. 2003-05-01 21:10:37 +00:00
Mark Murray
8edde085dd De-Kerberise (KerberosIV). KerberosIV is no longer present, and
remote backups can still be done with Kerberos authentication using
SSH and Kerberos 5.
2003-05-01 20:09:58 +00:00
Sheldon Hearn
c359d71a85 Add TAPE to the ENVIRONMENT section.
MFC after:	1 month
2003-01-10 10:55:13 +00:00
Sheldon Hearn
d1d5a33b13 Add an ENVIRONMENT section so that the reader knows that the TMPDIR envar
is honoured.

Reported by:	des
MFC after:	1 month
2003-01-10 10:45:48 +00:00
Ruslan Ermilov
463cfa804d Fixed the abuses of .Ql visible on stderr in troff mode.
PR:		docs/37176
2002-12-23 16:04:51 +00:00
Mike Barcroft
89fdc4e117 Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
Philippe Charnier
7fed38d0a0 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
Warner Losh
0b0fe61dfb Use '0' instead of NULL when we mean the integer constant 0 and not a
"null pointer expression".
2002-08-21 18:52:32 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Kirk McKusick
fb36a3d847 Change utimes to set the file creation time (for filesystems that
support creation times such as UFS2) to the value of the
modification time if the value of the modification time is older
than the current creation time. See utimes(2) for further details.

Sponsored by:	DARPA & NAI Labs.
2002-07-17 02:03:19 +00:00
Philippe Charnier
629e80effb The .Nm utility. 2002-07-06 19:35:14 +00:00
Kirk McKusick
1c85e6a35d This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
Tom Rhodes
3468b317cb more file system > filesystem 2002-05-16 04:10:46 +00:00
Ian Dowse
a255f2f8fa Address a few minor style and consistency issues in revision 1.32.
Submitted by:	Joshua Goodall <joshua@roughtrade.net>
2002-05-06 15:15:51 +00:00
Ian Dowse
915a1dab22 Set the permissions on restored symbolic links.
PR:		bin/37665
Submitted by:	"Michael C. Adler" <mad1@tapil.com>
2002-05-02 17:39:19 +00:00
Ruslan Ermilov
71b3ac84e1 Replaced exists() tests with two equivalent defined().
LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.
2002-04-18 07:01:35 +00:00
Tom Rhodes
9532eef22c restore(8) manual page does not explain rrestore.
PR:		34234
Submitted by:	Gary W. Swearingen <swear@blarg.net>
2002-04-12 18:31:09 +00:00
Warner Losh
2db673ab00 o remove __P
o Use ANSI function definitions
o unifdef -D__STDC__
2002-03-20 22:49:40 +00:00
David E. O'Brien
3d438ad61f Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
 "register" -- just how many free registers do people think machines have?)
2002-03-20 17:55:10 +00:00
Ian Dowse
ab3d6ee098 Use a more robust scheme for determining how many blocks to skip
after an EOT-terminated volume. We keep track of the current record
number, and synchronise it with the c_tapea field each time we read
a header. Avoid the use of c_firstrec because some bugs in dump can
cause it to be set incorrectly.

Move the initialisation of some variables to avoid compiler warnings.
2002-02-18 02:29:47 +00:00
Ian Dowse
dea08b6818 When we reach the end of the dump in findinode(), ask for another
volume if we missed some earlier tapes (the user can still enter
'none' later if the tapes are unavailable). Previously with 'x'
restores, we might not ask for all tapes if the tapes are supplied
in reverse order.

Clarify the message that describes what volume should be mounted
first; reverse order is only efficient when extracting a few files.
2002-02-18 00:54:18 +00:00
Ian Dowse
cfd8a00918 In createfiles(), properly handle a number of cases where no further
volumes are available, instead of getting stuck in a loop calling
getvol(). Normally restore in 'x' or 'i' modes will ask for a new
(earlier) volume when the current inode number on the tape is greater
than the last inode to be restored, since there can be no further
inodes of interest on that volume. However we don't want to change
volumes in this case either if the user explicitly said that there
are no more tapes, or if we are looking at the first volume.

When no more volumes are available but there are still inodes that
we have not found, we now just fall through to the code that prints
out a list of any missing files, so the restore completes normally.
Also simplify the logic a bit by always returning to the start of
the main for(;;) loop whenever the volume has changed.

This should completely fix the "Changing volumes on pipe input" bug
that is often observed when restoring dumps of active filesystems.

PR:		bin/4176, bin/34604, misc/34675
2002-02-14 01:30:45 +00:00
Ian Dowse
1603684d77 Fix a number of long-standing restore bugs in tape.c, mainly relating
to multi-volume restores:
 - In findinode(), keep a copy of header->c_type so that we don't
   exit the do-while loop until we have processed the current header.
   Exiting too early leaves curfile.ino set to 0, which confuses
   the logic in createfiles(), so multi-volume restores with the
   'x' command don't work if you follow the instructions and supply
   the tapes in reverse order.  This appears to have been broken
   by CSRG revision 5.33 tape.c (Oct 1992).
 - The logic in getvol() for deciding how many records to skip after
   the volume header was confused; sometimes it would skip too few
   records and sometimes too many, leading to "resync restore"
   warnings and missing files. Skip to the next header only when
   the current action is not `USING'. Work around a dump bug that
   sets c_count incorrectly in the volume header of the first tape.
   Some of the problems here date back to at least 1991.
 - Back out revision 1.23. This appeared to avoid warnings about
   missing files in the 'rN' verification case, but it made the
   problems with the 'x' command worse by stopping getvol() from
   even attempting to find the first inode number on the newly
   inserted tape. The bug it addressed is fixed by correcting the
   skipping logic as described above.
 - Save the value of `tpblksread' in case the wrong volume is
   supplied, because it is incremented each time we read a volume
   header. We already saved `blksread' for the same reson.
2002-02-13 12:06:58 +00:00
Ian Dowse
b6024ea8ed Don't refer to findinode()'s `complain' parameter in a comment; it
was removed in 1986.
2002-02-12 17:15:45 +00:00
Matthew Dillon
170ac683f2 I've been meaning to do this for a while. Add an underscore to the
time_to_xxx() and xxx_to_time() functions.  e.g. _time_to_xxx()
instead of time_to_xxx(), to make it more obvious that these are
stopgap functions & placemarkers and not meant to create a defacto
standard.  They will eventually be replaced when a real standard
comes out of committee.
2002-01-19 23:20:02 +00:00
David E. O'Brien
2d68bf45bf Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
Anton Berezin
646d372751 Fix a bug where restore(8) segfaults while trying to restore on a
read-only FS.

Reviewed by:	audit silence
Approved by:	markm
MFC after:	2 weeks
2001-10-30 20:06:59 +00:00
Matthew Dillon
5b3817c60b Make the protocol/dumprestore.h header match restore's idea of the dump
header for the case where sizeof(time_t) != sizeof(int).  dumprestore.h
was embedding time_t when it should have been embedding int32_t.

Use time_to_time32() and time32_to_time() to convert between the
protocoll/file-format time and time_t.
2001-10-28 20:01:38 +00:00
Crist J. Clark
a17d5ec55d Documentation fixes:
- The '-d' option was not documented on the manpage or in the
    usage message.

  - The '-N' option was not included in the usage.
2001-10-02 08:24:37 +00:00
Ruslan Ermilov
860ca8fd85 restore(8) doesn't need to be setgid `tty', and never did.
At the times, restore(8) and rrestore(8) were the different
utilities.  rrestore(8) was installed setuid `root', while
restore(8) with usual ownership and privileges.  Later on,
on August 28, 1991 (what a coincidence!), rrestore(8) code
was merged with restore(8).  The setgid `tty' bit then was
accidentally put.
2001-08-30 09:18:55 +00:00
Dima Dorfman
a5ef8459cc Fix grammar. 2001-08-20 02:16:41 +00:00
Dima Dorfman
b9595aa55f Respect the -N flag when changing directory attributes in setdirmode).
PR:		29671
Submitted by:	Sascha Blank <sblank@addcom.de>
2001-08-20 02:15:22 +00:00
Kris Kennaway
5979df34a6 Silence non-constant format string warnings by marking functions
as __printflike()/__printf0like(), adding const, or adding missing "%s"
format strings, as appropriate.

MFC after:	2 weeks
2001-08-19 08:19:37 +00:00
Maxim Sobolev
4afde8553d Honour `TMPDIR' environment variable.
Reviewed by:	ru
Approved by:	ru
MFC after:	2 weeks
2001-08-13 09:20:15 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
9fe48c6e8d mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 11:04:34 +00:00
Dima Dorfman
cafefe8c1b Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 23:04:23 +00:00
Mike Heffner
26f4fa24e3 Document the interactive command `what'.
Reviewed by:	ru
MFC after:	2 weeks
2001-06-20 04:00:43 +00:00
Matt Jacob
428133f142 Add 'SKIP' as an action so that verification works for multivolume restores.
Tested with filesystem files.

PR:		27218
Submitted by:	mad1@tapil.com
MFC after:	3 weeks
2001-06-11 01:44:06 +00:00
Ruslan Ermilov
0a5779d45b - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:33:27 +00:00
Ruslan Ermilov
fe655281c5 Set the default manual section for sbin/ to 8. 2001-03-20 18:13:31 +00:00
David E. O'Brien
02344806db bye-bye documented raw device 2001-03-09 13:06:09 +00:00
David E. O'Brien
8454c72c24 Move _PATH_DEFTAPE to <paths.h> to remove all the duplication of definitons,
and remove leading `r'(aw) from it.
2001-03-08 09:04:40 +00:00
Ruslan Ermilov
47dec78170 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
Ruslan Ermilov
896eb7d10c Prepare for mdoc(7)NG. 2001-01-16 09:15:57 +00:00
Ruslan Ermilov
1252c1bb05 Prepare for mdoc(7)NG. 2000-12-18 15:16:24 +00:00
Ian Dowse
5a59cccc61 Stop restore from looping under certain error conditions. This
corrects cases where restore would spew an infinite stream of
"Changing volumes on pipe input?" messages, or would loop waiting
for a response to the "set owner/mode for '.'" question.

PR:		bin/14250
Reviewed by:	dwmalone
2000-12-12 12:04:02 +00:00
Kirk McKusick
522b7bcdf6 Don't give up on file write errors. Just log them and continue. 2000-12-12 06:30:42 +00:00
Ruslan Ermilov
7c7fb079b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Garrett Wollman
eb2fc78027 Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).
2000-10-10 01:50:26 +00:00
Matt Jacob
cbd8ecd6ac Fix sign extension.
PR:		21232
Obtained from:	Christian Weisgerber <naddy@mips.inka.de>
2000-09-12 21:42:58 +00:00
Sheldon Hearn
d84f2470c3 Add text from NetBSD's rev 1.12 which should have accompanied
the changes made to our own source on 1997-01-01.

PR:		20445
Submitted by:	Jon Masami Kuroda <jkuroda@eecs.berkeley.edu>
2000-08-11 10:37:39 +00:00
David Malone
fddde8b056 Don't try to make files immutable (ie. chflags) before setting access times.
PR:		19973
Submitted by:	Arjan de Vet <Arjan.deVet@adv.iae.nl>
Reviewed by:	Matthew Jacob <mjacob@feral.com>
2000-07-16 23:22:15 +00:00
Kris Kennaway
334f24bbab Update references to disk and tape devices. 2000-05-07 09:16:56 +00:00
Sheldon Hearn
ef8f7ac935 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 11:27:47 +00:00
Nik Clayton
b1ba45cfe5 Remove xrefs to obsolete ft driver.
PR:             docs/17080
Submitted by:   Udo Erdelhoff <ue@nathan.ruhr.de>
2000-03-01 10:40:18 +00:00
Mark Murray
f499a39621 Use libcrypto instead of libdes. 2000-02-24 21:01:54 +00:00
Bill Swingle
0169694662 Committed changes to restore(8) for previously undocumented -N option.
PR:		15600
Reviewed by:	jim
2000-02-17 02:15:18 +00:00
Alexey Zelkin
0c39ec0311 Add `.Nm rrestore' to NAME section. 2000-01-10 12:27:33 +00:00
Mark Murray
1099209e99 Prepare for K5. 1999-09-20 06:21:51 +00:00
Mark Murray
105b74f110 Fix for new KerberosFix for new Kerberos44 1999-09-19 22:14:33 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Warner Losh
e254596824 Fix two possible non-exploitable buffer overflows.
Thanks to: A friend at Sun auditing dump/restore for Solaris.
1998-12-16 04:48:00 +00:00
Robert Nordier
c276ec5a07 Refer to "da" rather than "sd" device. 1998-11-28 10:02:52 +00:00
Dima Ruban
97b465b142 64bit fixes.
(Note: ``dump'' doesn't work on alpha yet. Apparently there's a problem
somewhere is the physio() area)

Submitted by:	myself && Matt Dillon.
1998-10-27 04:01:19 +00:00
Ollivier Robert
4a73c49a6d Change rst0 into rsa0. 1998-09-22 10:05:27 +00:00
David E. O'Brien
be0cde6f10 Remove useless `BINOWN=root' now that it is the default. 1998-09-19 22:42:06 +00:00
Warner Losh
fc1e823247 Prevent buffer overflow with extra long arguments. 1998-09-17 20:18:11 +00:00
Mark Murray
448bbb5805 Fix LIBDIR (for aout/ELF). 1998-08-06 21:41:13 +00:00
Warner Losh
49a3215509 Commit patch from Tor Egge to fix the "large filesystem restore" problem.
This appears to work for me in the old case, but I don't have large
enough filesystems to test the fix case.

Reported working by: karl@mcs.net
1998-07-28 18:50:01 +00:00
Philippe Charnier
91ac32e405 Add rcsid. Remove unused #includes. Add missing prototypes and others -Wall
cleanings. Spelling.
1998-07-28 06:20:16 +00:00
John Polstra
adb915cb28 Fix a bug that prevented the restoration of hard links to files that
had the schg flag set.  Reported by Matthew Thyer <thyerm@camtech.net.au>.
1998-07-09 03:57:26 +00:00
Bruce Evans
7fafc6f67c Fixed printf format errors. Sure is dusty here. 1998-06-28 20:25:59 +00:00
Jordan K. Hubbard
2640840497 Well, nobody objected, so here's my -u (unlink) flag to restore. 1998-05-09 05:23:02 +00:00