]> Dogcows Code - chaz/tar/commit
tar: --atime-preserve fixes for races etc.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 16 Sep 2010 17:16:47 +0000 (10:16 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 16 Sep 2010 17:17:04 +0000 (10:17 -0700)
commitecbcb7b6d74c2d69386c8d7e435486a4690c9993
tree923b0df5324f20a3b06e651ac61fbc2ee3b54320
parent59146768ef4a2c045239628b7179ea477563d63f
tar: --atime-preserve fixes for races etc.

This patch fixes a race condition in the --atime-preserve=replace
option, which might cause tar to improperly follow a symbolic link.

It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
and later, which loses resolution on time stamps.  Modern Solaris
systems support full-resolution time stamps in the kernel, and
it's not worth the hassle of testing this call, useful only in
no-longer-supported Solaris variants.

Also, it undoes a change I recently introduced to the --compare
option, which caused it to not follow symbolic links unless the
--dereference option was also used.  Quite possibly this change is
a good idea, but the old behavior was documented and the change
should not have been installed casually.

* configure.ac: Don't check for stropts.h and sys/filio.h.
* gnulib.modules: Add futimens, utimensat.  Remove futimens.
* src/common.h (fd_utimensat): New decl.
* src/compare.c (diff_file, diff_multivol):
Don't use open_read_flags: those are for --create only.
* src/create.c (dump_file0): Adjust to set_file_atime changes.
Pass fstatat_flags to set_file_atime, so that symbolic links are
not followed inadvertantly.
* src/extract.c: Don't include utimens.h.
(set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
* src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
(fd_utimensat): New function.
(set_file_atime): Use it.  New arg atflag, controlling symlink
handling.  All callers changed.
configure.ac
gnulib.modules
src/common.h
src/compare.c
src/create.c
src/extract.c
src/misc.c
This page took 0.021914 seconds and 4 git commands to generate.