summaryrefslogtreecommitdiffstats
path: root/sbin/restore
Commit message (Collapse)AuthorAgeFilesLines
* restore: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-192-4/+4
| | | | While here cleanup a little a malloc call.
* malloc will return NULL if it cannot allocate memory.araujo2016-04-191-1/+1
| | | | MFC after: 2 weeks.
* Use NULL instead of 0 for pointers.araujo2016-04-181-1/+1
| | | | | | | strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks.
* MFHgjb2016-04-041-0/+1
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * restore(8): fix use of uninitialized value.pfg2016-03-311-0/+1
| | | | | | | | | | | | Prevent uninitialized use of scalar newvol when jumping to gethdr. CID: 1006491
* | Explicitly add more files to the 'runtime' package.gjb2016-02-091-0/+1
|/ | | | Sponsored by: The FreeBSD Foundation
* If you backup a large file that is mostly holes, previously we'd issuejmg2015-11-161-3/+27
| | | | | | | | | | a seek for every block... For large (Exabyte sized files) this would issue lots of unneeded seeks, so combine them... Thanks for the work Jan, sorry took so long to commit... And an item completed off the IdeasPage! Submitted by: Jan Sucan
* Add META_MODE support.sjg2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-272-21/+23
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-191-3/+5
| |\
| * | Updated dependenciessjg2014-05-161-1/+0
| | |
| * | Updated dependenciessjg2014-05-101-0/+2
| | |
| * | Updated dependenciessjg2013-03-111-0/+1
| | |
| * | Updated dependenciessjg2013-02-161-2/+0
| | |
| | |
| | \
| *-. \ Sync from headsjg2012-11-045-32/+44
| |\ \ \
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+20
| | |/ / | |/| | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | restore: Preserve timestamps to the nanosecond.jilles2015-03-142-21/+23
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | The restore utility already knows the full-resolution timestamps, so the only thing to do is to stop converting the timespecs to timevals and use futimens() and utimensat(). Differential Revision: https://reviews.freebsd.org/D2020 Reviewed by: jhb
* | | When restoring a UFS dump onto a ZFS filesystem, an assertion inmckusick2014-07-301-3/+5
| |/ |/| | | | | | | | | | | | | | | | | | | restore was failing because ZFS was reporting a blocksize that was not a multiple of 1024. Replace restore's failed assertion with code that writes restored files in a blocksize that works for restore (a multiple of 1024) despite being non-optimal for ZFS. Submitted by: Dmitry Morozovsky Tested by: Dmitry Morozovsky MFC after: 1 week
* | Check the return error of set[e][ug]id. While this can never fail in theeadler2012-10-221-1/+5
| | | | | | | | | | | | | | | | | | | | current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. Submitted by: Erik Cederstrand Approved by: cperciva MFC after: 3 days
* | Fix sbin/ build with a 64-bit ino_t.mdf2012-09-275-31/+39
|/ | | | Original code by: Gleb Kurtsou
* Make sure that each va_start has one and only one matching va_end,kevlo2012-05-291-0/+1
| | | | especially in error cases.
* mdoc: move two sentences from synopsis to description (where they reallyjoel2012-05-231-10/+8
| | | | belong). With this change, mandoc now formats these manpages properly.
* mdoc: make pages render with mandocuqs2010-10-211-1/+0
| | | | | | It's a bit more pedantic regarding .Bl list elements. This has an added benefit of unbreaking the ipfw(8) manpage, where groff was silently skipping one list element.
* Fix grammar in a line of output.brueffer2010-05-121-1/+1
| | | | | | PR: 145343 Submitted by: Hywel Mallett <hywel@hmallett.co.uk> MFC after: 1 week
* Fix common misspelling of hierarchyuqs2010-02-201-1/+1
| | | | | Pointed out by: bf1783 at gmail Approved by: np (cxgb), kientzle (tar, etc.), philip (mentor)
* Don't try to determine tape block size when the -P option is used.jh2010-02-131-1/+1
| | | | | | This was missed in r203157. PR: bin/121502
* - Handle short reads when the -P option is used. Short reads must bejh2010-01-291-8/+3
| | | | | | | | | | handled when reading from pipes. - Remove dead code related to the -P option from getvol(). pipein and pipecmdin are never set at the same time. PR: bin/121502 Approved by: trasz (mentor) MFC after: 2 weeks
* - Cast time_t, int64_t and some int32_t values to intmax_t and use "%jd"jh2010-01-295-25/+29
| | | | | | | | | | | | | in format strings. - Use (void) instead of (void *) when discarding strcat(3) return value. - Format string fixes to match variable types. - Change canon() len parameter and getcmd() size parameter type from int to size_t. - Style Makefile and increase WARNS to 2. PR: bin/140061 Submitted by: uqs Approved by: trasz (mentor)
* Make 'struct acl' larger, as required to support NFSv4 ACLs. Providetrasz2009-05-221-1/+1
| | | | | | compatibility interfaces in both kernel and libc. Reviewed by: rwatson
* Restore necessary NUL termination of locname.imp2009-01-281-0/+1
| | | | | Submitted by: ian dowse MFC after: 2 days
* Fix nits pointed out in PR bin/39905 that have not already beenmckusick2008-05-231-3/+3
| | | | | | corrected since it was filed. With this change the PR will be closed. PR: bin/39905
* This fixes the "getfile: lost data" panic when restoring dumpsmckusick2008-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | on a 7.0 or later system that were created on a pre-5.0 system. We must ensure that restore zeros out the previously undefined birthtime and external attribute size fields when reading dump tapes made by the UFS1 dump program. The problem is that UFS2 dump carefully zeros out the unused birthtime and external attribute size fields in the dump header when dumping UFS1 filesystems, but the UFS1 dump didn't know about those fields (they were spares) so just left whatever random junk was in them. So, when restoring one of these pre-UFS2 dumps, the new restore would eventually trip across a header that had a non-zero external attribute size and try to extract it. That consumed several tape blocks which left it totally out of sync and very unhappy (i.e., the panic). The fix is in the gethead() function which modernizes old headers by copying old fields to their new location (and with this fix) zeroing out previously undefined fields. PR: bin/120881 Review by: David Malone & Scott Lambert MFC after: 1 week
* Follow on to fix 1.51 for "Header with wrong dumpdate" message.mckusick2008-05-221-16/+10
| | | | | | | | | | | Must ensure that dump tapes from UFS1 filesystems properly copy old fields of dump headers to new locations. Move check of dumpdate to follow the code which ensures that the appropriate fields have been copied. PR: bin/118087 Help from: David Malone, Scott Lambert, Javier Martín Rueda MFC after: 2 weeks
* restore(8) does not check for write failure while building two tempmckusick2008-04-141-24/+68
| | | | | | | | | | | files containing directory and ownership data. If /tmp fills, the console is blasted with zillions of "file system full" errors, and restore continues on, even though directory and/or ownership data has been lost. This is particularly likely to happen when running from the live CD, which has little /tmp space. PR: bin/93603, also probably bin/107213 Fix from: Ken Lalonde
* Avoid printing spurious ``Header with wrong dumpdate.'' message.mckusick2008-04-111-1/+1
|
* Correctly set file group when restore is run by a user other than root.mckusick2008-04-112-2/+9
|
* Use safer string handling.imp2008-04-032-11/+8
| | | | Reviewed by: security-team
* Move macros describing extended attributes in UFS frommckusick2007-03-061-0/+1
| | | | | | | | | | | <sys/extattr.h> to <ufs/ufs/extattr.h>. Move description of extended attributes in UFS from man9/extattr.9 to man5/fs.5. Note that restore will not compile until <sys/extattr.h> and <ufs/ufs/extattr.h> have been updated. Suggested by: Robert Watson
* Update the dump program to save extended attributes. Updatemckusick2007-02-264-26/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the restore program to restore all dumped extended attributes. If the restore is running as root, it will always be able to restore all extended attributes. If it is not running as root, it makes a best effort to set them. Using the -v command line flag or the `verbose' command in interactive mode will display all the extended attributes being set on files (and at the end on directories) that are being restored. It will note any extended attributes that could not be set. The extended attributes are placed on the dump image immediately following each file's data. Older versions of restore can work with the newer dump images. Old versions of restore will correctly restore the file data and then (silently) skip over the extended attribute data and proceed to the next file. This resolves PR 93085 which will be closed once the code has been MFC'ed. Note that this code will not compile until these header files have been updated: <protocols/dumprestore.h> and <sys/extattr.h>. PR: bin/93085 Comments from: Poul-Henning Kamp and Robert Watson MFC after: 3 weeks
* Add a "-D" flag to restore which puts it into "degraded" mode. Thisdwmalone2006-12-055-22/+104
| | | | | | | | | | | | | | | | | | makes restore less efficient, but it makes a bigger effore to read corrupted dumps. Specifiacally, when in degreded mode: 1) Restore shifts the input by 1 byte if it sees a problem, rather than one tape block. 2) It doesn't assume the inodes are stored in ascending order. 3) It turns some panics into warning printfs. We also verify some fields more carefully than before. There's probably more a degreded mode could do, but this seems to help a lot. Approved by: imp, iedowse, mckusick MFC after: 3 weeks
* Mention the -L option of dump(8) that can neutralize negativeru2006-10-121-2/+5
| | | | | | effects of restoring dumps of live file systems. PR: docs/91297
* o Fix style(9) for previous.maxim2006-08-251-1/+1
|
* A bunch of fixes from NetBSD:maxim2006-08-251-17/+23
| | | | | | | | | | | | | | | | | | o Restore owner/group/mode/atime/mtime of symbolic links, rev. 1.30. o Extract file flags of symbolic link, rev. 1.42. o Call getfile() before altering file attributes. Open file with mode 0600 instead of 0666 so that file won't remain group or world readable/writable even if getfile() terminated. Move skipfile() before altering file attributes in IF{CHR,BLK} and IFIFO case for symmetry, rev. 1.32. o Use file mode 0600 when creating special file or fifo, revs. 1.33, 1.34. o Remove redundant -N check. PR: bin/101660 Submitted by: Andrey V. Elsukov Obtained from: NetBSD, enami@netbsd MFC after: 6 weeks
* Remove a diagnostic message that can't occur: we lost the ability todds2005-10-201-3/+0
| | | | handle the old filesystem format on 2002/06/21.
* Interpret correctly the glob(3) return value.dds2005-07-211-1/+7
| | | | | | | Previously, interactive commands specifying a non-existent file or directory used to display an "out of memory error". MFC after: 2 weeks
* rscid -> __FBSDID. Mark parameter as __unused when necessary.charnier2005-05-294-9/+13
|
* Remove debug from last commitimp2005-04-031-2/+0
|
* /*-imp2005-04-031-1/+1
|
* Revert bogus += -g change. I needed it to debug the problem.imp2005-03-251-1/+0
| | | | Noticed by: njl, Andrej Tobola
OpenPOWER on IntegriCloud