summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tar.morph: use autotools, PREFIXbaserock/bootstrap-pass1Richard Maw2012-03-141-7/+2
| | | | | | Use build-system: autotools for brevity Use PREFIX if it is set
* add output of bootstrapbaserock/bootstrap-deprecatedRichard Maw2012-01-16725-90/+438395
| | | | alters .gitignores and removes bootstrap step from morph
* add morphRichard Maw2012-01-161-0/+14
|
* tar: fix core dump with --index-file=bad_pathPaul Eggert2012-01-111-2/+2
| | | | | | * src/tar.c (decode_options): Exit cleanly if index file won't open. Problem reported by Khanh-Dang Nguyen Thu Lam in <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00018.html>.
* tar: don't assume O_NONBLOCK is benign on regular filesPaul Eggert2012-01-066-10/+64
| | | | | | | | | | | | | | | | | On Data Migration Facility (DMF), High Peformance Storage System (HPSS), and presumably other file systems based on hierarchical storage, opening a regular file with O_NONBLOCK can cause later reads to fail with errno == EAGAIN. We need the O_NONBLOCK to avoid some security races. Work around the problem by using fcntl to clear the O_NONBLOCK flag if I/O fails with that errno value. Problem reported by Vitezslav Cizek in <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00000.html>. * src/common.h (blocking_read, blocking_write): New decls. * src/misc.c (blocking_read, blocking_write): New functions. * src/compare.c (process_rawdata): * src/create.c (dump_regular_file): * src/extract.c (extract_file): * src/sparse.c (sparse_scan_file, sparse_extract_region):
* Fix --keep-old-files option.Sergey Poznyakoff2011-11-2610-27/+209
| | | | | | | | | | | | | | | | | | | The regression was introduced by 8f390db9. This patch implements additional option --skip-old-files, which silently skips members which would cause writing over existing files, and restores --keep-old-files to its traditional behavior. * NEWS: Update. * configure.ac: Update. * doc/tar.texi: Document the changes. * src/common.h (SKIP_OLD_FILES): New old_files mode. * src/extract.c (maybe_recoverable): Restore KEEP_OLD_FILES behavior. Handle SKIP_OLD_FILES. * src/tar.c: New option --skip-old-files. * tests/extrac18.at: New file. * tests/extrac19.at: New file. * tests/Makefile.am: Add new test cases. * tests/testsuite.at: Likewise.
* Warn about existing files in keep-old-files mode (complements 8f390db9).Sergey Poznyakoff2011-11-173-2/+7
| | | | | | | | | | | This is controlled by "existing-file" warning code, which is off by default. * src/common.h (WARN_EXISTING_FILE): New warning code. (WARN_VERBOSE_WARNINGS): Add WARN_EXISTING_FILE. * src/extract.c (maybe_recoverable): warn about existing file if WARN_EXISTING_FILE is set. * src/warning.c: New warning type: "existing-file"
* Fix the "Creating directory:" outputSergey Poznyakoff2011-11-171-2/+2
| | | | | * src/list.c (print_for_mkdir): don't use unquoted name length for computing its output width.
* Fix operation of --verify in conjunction with --listed-incrementalSergey Poznyakoff2011-11-153-11/+49
| | | | | | | | | | * src/common.h (clear_directory_table): New proto. * src/incremen.c (clear_directory_table): New function. * src/compare.c (diff_dumpdir): Take a pointer to struct tar_stat_info as argument. Initialize its fd. (diff_archive): Update call to diff_dumpdir. (verify_volume): Call clear_directory_table.
* * doc/tar.texi (Option Summary, absolute): Document -P better,Paul Eggert2011-10-181-3/+8
| | | | by describing how it deals with symbolic links on extraction.
* 2011-09-27 Paul Eggert <eggert@cs.ucla.edu>Paul Eggert2011-09-271-1/+4
| | | | * src/tar.c (stat_on_signal): Use SA_RESTART if available.
* * doc/tar.texi: Remove front- and back-cover texts.Paul Eggert2011-09-201-11/+7
| | | | | These are no longer needed for this manual, according to the GNU maintainers guide. Update copyright date to 2011.
* Minor changes.Sergey Poznyakoff2011-09-191-54/+54
| | | | | * scripts/tar-snapshot-edit: License under GPLv3+. Remove trailing whitespace.
* Minor changes.Nathan Stratton Treadway2011-09-191-7/+10
| | | | | | * doc/snapshot.texi: Clarify the use of nfs field in 0 and 1 formats. Give more precise information about which versions of tar used each format.
* Upgrade tar-snapshot-edit script.Nathan Stratton Treadway2011-09-192-86/+304
| | | | | | | | | | | | | | * scripts/tar-snapshot-edit: Update Perl syntax to work correctly with more recent versions of Perl. (The original code worked with in the v5.8 timeframe but not with Perl v5.10.1 and later.) Add a "-c" option to check the snapshot file for invalid field values. Handle NFS indicator character ("+") in version 0 and 1 files. Preserve the original header/version line when editing version 1 or 2 files. Tweak output formatting. * doc/tar-snapshot-edit.texi: Update documentation.
* tar: --owner and --group names and numbersPaul Eggert2011-08-138-38/+174
| | | | | | | | | | | | | | | | | | | | | The --owner and --group options now accept operands of the form NAME:NUM, so that you can specify both symbolic name and numeric ID for owner and group. Also, in these options, NAME no longer needs to be present in the current host's user and group databases; this implements Debian enhancement request 136231 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136231> reported by Mark W. Eichin, communicated by Thayne Harbaugh to bug-tar in <http://lists.gnu.org/archive/html/bug-tar/2011-08/msg00001.html>. * NEWS, doc/tar.texi (Option Summary, override): Document enhancement. * src/common.h (group_name_option, owner_name_option): New decls. * src/create.c (start_header): Don't assume owner and group names are in current host database. * src/tar.c (parse_owner_group): New function, for parsing NAME:NUM. (parse_opt): Use it. (decode_options): Initialize owner_name_option, group_name_option. * tests/owner.at: New file, to test this enhancement. * tests/Makefile.am (TESTSUITE_AT): Add it. * tests/testsuite.at: Include it.
* .gitignore: updatePaul Eggert2011-08-132-0/+11
| | | | | * .gitignore: Add rmt. * lib/.gitignore: New file.
* Fix the --exclude-backups option.Sergey Poznyakoff2011-07-304-4/+40
| | | | | | | | | * src/tar.c (add_exclude_array): Take exclude option filags in its second argument. (parse_opt): Register backup_file_table with the EXCLUDE_WILDCARDS flag. * tests/exclude07.at: New testcase. * tests/Makefile.am (TESTSUITE_AT): Add testsuite.at. * tests/testsuite.at: Include exclude07.at.
* tar: simplify birthtime calculationsPaul Eggert2011-06-071-11/+3
| | | | | | | * src/extract.c (same_birthtime): Remove. (extract_link, apply_delayed_links): Go back to using timestamp_cmp instead of same_birthtime, as this is a bit simpler. This fix relies on an up-to-date gnulib.
* tar: use birthtime rather than ctime when checking identityPaul Eggert2011-06-071-7/+19
| | | | | | | | | | | Without this fix, tar would sometimes mishandle the extraction of hard links to symbolic links. Problem reported in <http://lists.gnu.org/archive/html/bug-tar/2011-06/msg00000.html> by Andreas Stolcke. * src/extract.c (struct delayed_link): Change ctime member to birthtime. (same_birthtime): New function. (create_placeholder_file, extract_link, apply_delayed_links): Use it to compare birthtimes (when available) instead of ctime.
* * doc/tar.texi (Old Options): Clarify distinction from short options.Paul Eggert2011-05-261-27/+23
| | | | | | Adjust other parts of the manual to use examples that parse the same regardless of whether "-" is in front of the option clump. See <http://lists.gnu.org/archive/html/bug-tar/2011-05/msg00022.html>.
* Testsuite fix.Sergey Poznyakoff2011-03-121-1/+1
| | | | * tests/sparse04.at: Use the -f option.
* Version 1.26release_1_26Sergey Poznyakoff2011-03-123-4/+17
| | | | | * NEWS, configure.ac: Update. * po/POTFILES.in: Remove paxexit.c (see bb971a1e).
* --atime-preserve=replace: fix correctness and performance bugsPaul Eggert2011-03-072-2/+4
| | | | | | | | reported by Eric Blake in <http://lists.gnu.org/archive/html/bug-tar/2011-03/msg00000.html>. * src/compare.c (diff_file): Do not restore atime of size-zero files. * src/create.c (dump_file0): Likewise. Also, do not restore atime when fd is zero, because that indicates a file we haven't opened.
* * doc/tar.texi: Adjust example commands and output for accuracy.Paul Eggert2011-02-221-38/+37
| | | | | The original problem was reported by Michael Witten in <http://lists.gnu.org/archive/html/bug-tar/2011-02/msg00033.html>.
* tar: if (p) free (p); -> free (p);Paul Eggert2011-02-163-16/+8
| | | | | | | | | | | There is no longer (since SunOS 4) any need to guard against free (NULL), so replace each "if (p) free (p);" with "free (p);". From Jim Meyering in <http://lists.gnu.org/archive/html/bug-tar/2011-01/msg00026.html>. * src/incremen.c (scan_directory, read_directory_file): As above. (try_purge_directory): Likewise. * src/list.c (read_header): Likewise. * src/misc.c (assign_string): Likewise.
* Correctly store long sparse file names in PAX archives.Sergey Poznyakoff2010-12-145-4/+57
| | | | | | | | | * src/sparse.c (pax_dump_header_1): Make sure the created header name is shorter than NAME_FIELD_SIZE bytes. * tests/sparse04.at: New testcase. * tests/Makefile.am (TESTSUITE_AT): Add sparse04.at. * tests/testsuite.at: Include sparse04.at. * NEWS: Update.
* tests: make the truncate test smaller and less buggy (tiny change)Paul Eggert2010-12-061-4/+3
| | | | | | | Reported by Solar Designer in <http://lists.gnu.org/archive/html/bug-tar/2010-12/msg00003.html>. * tests/truncate.at: Use a smaller test case, and make its race condition less likely.
* tests: skip SIGPIPE-dependent tests in environments ignoring SIGPIPEPaul Eggert2010-11-263-1/+12
| | | | | | | | Problem reported by Sven Joachim in <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00043.html>. * tests/remfiles01.at: Use AT_SIGPIPE_PREREQ. * tests/sigpipe.at: Likewise. * tests/testsuite.at (AT_SIGPIPE_PREREQ): New macro.
* tar: work around NetBSD and Tru64 symlink incompatibility with POSIXPaul Eggert2010-11-241-1/+10
| | | | | | | Problem reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00306.html>. * src/extract.c (maybe_recoverable): Also treat EFTYPE (if defined) and ENOTSUP like ELOOP.
* tar: adjust to paxutils change: paxexit.c -> paxexit-status.cPaul Eggert2010-11-231-1/+1
| | | | | * lib/Makefile.am (libtar_a_SOURCES): paxexit.c renamed to paxexit-status.c.
* tar: remove unused function dir_removed_diagPaul Eggert2010-11-232-17/+0
| | | | | * src/common.h (dir_removed_diag): Remove unused decl. * src/misc.c (dir_removed_diag): Remove unused function.
* tar: work around FreeBSD symlink incompatibility with POSIXPaul Eggert2010-11-231-0/+3
| | | | | | * src/extract.c (maybe_recoverable): Treat EMLINK like ELOOP, for FreeBSD. Problem reported by Christian Weisgerber in <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html>.
* * src/names.c: tar: fix bug with --one-file-system --listed-incrementalPaul Eggert2010-11-224-35/+4
| | | | | | | | | | | | | Problem (and idea for fix) reported by Martin Weigel <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html>. * src/common.h (is_individual_file): Remove decl. * src/create.c (dump_file0): Replace "is_individual_file (p)" with "top_level". * src/incremen.c (procdir): Replace "!is_individual_file (name_buffer)" with "st->parent". Fix bug with --one-file-system and --listed-incremental. * src/names.c (individual_file_table, register_individual_file): (is_individual_file): Remove. All uses removed.
* tests: new test listed04 for --one-file-system --listed-incrementalPaul Eggert2010-11-223-0/+49
| | | | | | * tests/Makefile.am (TESTSUITE_AT): Add listed04.at. * tests/listed04.at: New file. * tests/testsuite.at: Include it.
* scripts: fix option parsingPaul Eggert2010-11-222-8/+9
| | | | | | | | | | | Problem reported by Dennis Wydra in <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00082.html>. * scripts/backup.in: Accept "-l LEVEL". Be more systematic about backslashes inside ``; it shouldn't matter for modern shells but it might matter for older ones. * scripts/restore.in: Likewise. * scripts/backup.in: Adjust implementation of -t/--time to match the new implementation of -l/--level.
* Issue a warning if the archive being compared contais transformed file names.Sergey Poznyakoff2010-11-153-2/+18
| | | | | | | * src/common.h (transform_program_p): New proto. * src/transform.c (transform_program_p): New function. * src/compare.c (verify_volume): Warn if the archive contains transformed file names.
* Minor change.Sergey Poznyakoff2010-11-151-1/+1
| | | | * doc/tar.texi: Reword the description of decompress-program.
* tar: fix --verify option, which broke in 1.24Paul Eggert2010-11-155-2/+50
| | | | | | | | | | | * NEWS: Document this. * src/compare.c (verify_volume): Decode the header before invoking diff_archive, as diff_archive no longer does this as of the 2010-06-28 commit. Also, don't try to invoke diff_archive on a zero block. * tests/Makefile.am (TESTSUITE_AT): Add verify.at. * tests/testsuite.at: Include verify.at. * tests/verify.at: New file.
* Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/tarPaul Eggert2010-11-087-22/+182
|\
| * Version 1.25release_1_25Sergey Poznyakoff2010-11-072-2/+30
| | | | | | | | | | * configure.ac: Version 1.25 * NEWS: Describe the changes.
| * Run alternative decompression programs if the principal one is not available.Sergey Poznyakoff2010-11-055-20/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compression programs are able to handle various compression formats (e.g. `gzip' can decompress files created by `compress', `xz' is able to handle lzma, etc.) Tar tries to use such programs for decompression if the principal decompressor cannot be started. * src/buffer.c (compress_type): Swap ct_none and ct_tar. (archive_compression_type): New static variable. (zip_magic): Remove program and option fields. (zip_program): New structure and static. (compress_program): Remove macro. (find_zip_program): New static function. (first_decompress_program,next_decompress_program): New functions. (open_compressed_archive): Set archive_compression_type instead of use_compress_program_option. * src/common.h (first_decompress_program) (next_decompress_program): New functions. (WARN_DECOMPRESS_PROGRAM): New flag. (WARN_VERBOSE_WARNINGS): Include WARN_DECOMPRESS_PROGRAM. * src/warning.c (warning_args): Add "decompress-program". (warning_types): Add WARN_DECOMPRESS_PROGRAM. * src/system.c (run_decompress_program): New function. (sys_child_open_for_uncompress): Use run_decompress_program instead of calling execlp directly.
* | tests: avoid spurious failure when VERSION_CONTROL envvar is setJim Meyering2010-11-081-1/+2
|/ | | | | * tests/backup01.at: Unset VERSION_CONTROL. Otherwise, when set to e.g., 'always', it would cause this test to fail.
* tests: fix some issues with signals, timestamps, "test" typoPaul Eggert2010-11-023-10/+10
| | | | | | | | | | * tests/extrac17.at: Add --warning=no-timestamp, to avoid bogus warning due to NFS clock skew. * tests/remfiles01.at: Discard diagnostics that some shells generate about broken pipes. * tests/sigpipe.at: Likewise. * tests/remfiles01.at: Fix typo: "test $EC" was written where "test $EC -ne 0" was intended.
* Fix extraction of device nodes.Sergey Poznyakoff2010-11-011-1/+1
| | | | | * src/extract.c (extract_node): Do not mask out node type. The bug was introduced in commit ea964cce.
* tar: don't cross struct member boundaries with OLDGNU_MAGICPaul Eggert2010-10-272-4/+8
| | | | | | | | | | | | | * src/create.c (write_gnu_long_link, start_header): Access header->buffer + offsetof (struct posix_header, magic), instead of header->header.magic, when reading or writing the OLDGNU_MAGIC pattern. The code violates the C standard without this change, and GCC warns about this if fortify checking is enabled. It's not a bug on traditional (i.e., non-debugging) platforms, but it does violate the C standard so it should be fixed. Problem originally reported by John Emil Karlson in <http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>. * src/list.c (decode_header): Likewise.
* tests: port to sh variants that squirrel away file descriptorsPaul Eggert2010-10-271-10/+16
| | | | | | | | | | | | | | | | | | OpenBSD /bin/sh, and some other sh variants, squirrel away file descriptors before closing them. For example, for "cat 3<&-" they first dup file descriptor 3 to a fd that is 10 or greater, then close 3 (because if "cat" had been a builtin command like ":" then they would have wanted to avoid the fork and restore the fd after ":" finished); and they treat ordinary (forking) commands the same as builtin commands. This approach fails after "ulimit -n 10". Work around this deficiency by closing the file descriptors before invoking ulimit. Problem reported by Christian Weisgerber in <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>; solution suggested by Jilles Tjoelker in <http://article.gmane.org/gmane.comp.shells.dash/415>. * tests/extrac11.at (scarce file descriptors): Close file descriptors before invoking ulimit -n.
* Transform file names when updating and appendig to archives.Sergey Poznyakoff2010-10-276-1/+49
| | | | | | | | | | This complements 28e91b48. * src/common.h (transform_stat_info): New prototype. * src/list.c (transform_stat_info): Remove static qualifier. * src/update.c (update_archive): Call transform_stat_info. * tests/Makefile.am (TESTSUITE_AT): Add append03.at * tests/testsuite.at: Include append03.at
* tests: port to Solaris diffPaul Eggert2010-10-261-6/+6
| | | | | | * tests/extrac13.at: Don't assume that "diff -c" outputs nothing when there are no differences. This is not true on Solaris, where it outputs "No differences encounted".
* tar: fix -x --overwrite bug (no --dereference, ! O_NOFOLLOW)Paul Eggert2010-10-261-0/+14
| | | | | | | | | This bug was discovered on Solaris 8. On older hosts lacking O_NOFOLLOW, tar -x --overwrite (without --dereference) follows symbolic links, causing the "extract over symlinks" test to fail. * src/extract.c (open_output_file): If O_NOFOLLOW is needed but does not work, check for a symlink separately.