]> Dogcows Code - chaz/tar/commit
tar: --dereference consistency
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 24 Sep 2010 02:41:05 +0000 (19:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 24 Sep 2010 02:41:47 +0000 (19:41 -0700)
commit14efeb9f956e38d7beaf3fbedb04d3f3bb9ece3a
tree3b7d9ef5c3e6a400952397174231f24838a1366c
parentefe26f98ec84856025f56673639d6bd520aa2e64
tar: --dereference consistency

This closes another race condition, that occurs when overwriting a
symlink with a regular file.
* NEWS (--dereference consistency): New section.
* doc/tar.texi (Option Summary): Describe new --deference behavior.
(dereference): Likewise.  Remove discussion that I didn't follow,
even before --dereference was changed.
* src/common.h (deref_stat, set_file_atime): Adjust signatures.
* src/compare.c (diff_file, diff_multivol): Respect open_read_flags
instead of rolling our own flags.  This implements the new behavior
for --dereference.
(diff_file, diff_dumpdir): Likewise, for fstatat_flags.
* src/create.c: Adjust to set_file_atime signature change.
* src/extract.c (mark_after_links, file_newer_p, extract_dir):
Likewise.
* src/incremen.c (try_purge_directory): Likewise.
* src/misc.c (maybe_backup_file): Likewise.
* src/extract.c (file_newer_p): New arg STP.  All callers changed.
(maybe_recoverable): New arg REGULAR.  All callers changed.
Handle the case of overwriting a symlink with a regular file,
when --overwrite is specified but --dereference is not.
(open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
consistency with file creation.  Add O_NOFOLLOW if
overwriting_old_files && ! dereference_option.
* src/incremen.c (update_parent_directory): Use fstat, not fstatat;
there's less to go wrong.
* src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
Instead, use fstatat_flags.
(set_file_atime): Remove ATFLAG arg.  All callers changed.
Instead, use fstatat_flags.
* src/names.c, src/update.c: Adjust to deref_stat signature change.
* src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
is not a file to be archived.
* tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
* tests/extrac13.at: New file.
* tests/testsuite.at: Include it.
14 files changed:
NEWS
doc/tar.texi
src/common.h
src/compare.c
src/create.c
src/extract.c
src/incremen.c
src/misc.c
src/names.c
src/tar.c
src/update.c
tests/Makefile.am
tests/extrac13.at [new file with mode: 0644]
tests/testsuite.at
This page took 0.025703 seconds and 4 git commands to generate.