* configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS. Check for stropts.h and sys/filio.h too, for _FIOSATIME. * doc/tar.texi: Change "modification time" to "data modification time", "change time" to "status change time", and "filesystem" to "file system", so that we use terminology consistent with POSIX. Use American spacing rather than French for sentence ends. "non-dependable" -> "undependable". (Option Summary, Attributes): Explain better the pitfalls of the --atime-preserve option, and suggest read-only mounts,loopback mounts, and noatime mounts for older systems. * doc/value.texi (op-atime-preserve-system): Renamed from op-atime-preserver-system to fix a misspelling. * src/common.h (enum atime_preserve): Use lower case for enum values. * src/compare.c: Don't include utimens.h; no longer needed. (diff_file): Use set_file_atime rather than utimens; avoid closing diff_handle until after this, so that we can set the file time stamp via the file descriptor rather than via its name. * src/create.c: Don't include utimens.h; no longer needed. (dump_regular_finish): Remove. All callers now do its work inline. (dump_dir): New arg FD. All callers changed. Use fdsavedir rather than savedir. (unknown_file_error): Arg is a const pointer now. (dump_file0): 2nd arg is a const pointer now. Treat directories more like files, with respect to --atime-preserve. For example, also warn if a directory changes while we are dumping it. Prefer file descriptors to file names when retrieving/setting file attributes; this saves path-resolution time and allows us to avoid changing mtime/ctime on Solaris when restoring atime as root. Use O_DIRECTORY when opening directories, to avoid some race conditions. Do not reset atime if mtime has changed. Report an error if we cannot reset atime. First cut at adding support for --atime-preserve=system. * doc/tar.texi (Option Summary): First cut at documenting it. All other uses of --atime-preserve changed to --atime-preserve=replace. * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system): New. (op-atime-preserve): Mention METHOD. * src/common.h (atime_preserve): New enum. (atime_preserve_option): Now of the enum type rather than bool. All uses changed. * src/compare.c (diff_file): Read with O_NOATIME if asked for. * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME if asked for. * src/tar.c (usage): Mention new usage. (parse_opt): Parse new usage.
80 lines
1.9 KiB
Plaintext
80 lines
1.9 KiB
Plaintext
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
|
|
# Test suite for GNU tar.
|
|
# Copyright (C) 2004 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
# 02110-1301, USA.
|
|
|
|
# Unreadable directories yielded error despite --ignore-failed-read.
|
|
|
|
AT_SETUP([ignfail])
|
|
AT_KEYWORDS([ignfail])
|
|
|
|
AT_TAR_CHECK([
|
|
if test -w / ; then
|
|
# The test is meaningless for super-user.
|
|
AT_SKIP_TEST
|
|
else
|
|
touch file
|
|
mkdir directory
|
|
touch directory/file
|
|
|
|
echo 1>&2 -----
|
|
chmod 000 file
|
|
tar cf archive file
|
|
status=$?
|
|
chmod 600 file
|
|
test $status = 2 || exit 1
|
|
|
|
echo 1>&2 -----
|
|
chmod 000 file
|
|
tar cf archive --ignore-failed-read file || exit 1
|
|
status=$?
|
|
chmod 600 file
|
|
test $status = 0 || exit 1
|
|
|
|
echo 1>&2 -----
|
|
chmod 000 directory
|
|
tar cf archive directory
|
|
status=$?
|
|
chmod 700 directory
|
|
test $status = 2 || exit 1
|
|
|
|
echo 1>&2 -----
|
|
chmod 000 directory
|
|
tar cf archive --ignore-failed-read directory || exit 1
|
|
status=$?
|
|
chmod 700 directory
|
|
test $status = 0
|
|
fi
|
|
],
|
|
[0],
|
|
[],
|
|
[
|
|
-----
|
|
tar: file: Cannot open: Permission denied
|
|
tar: Error exit delayed from previous errors
|
|
-----
|
|
tar: file: Warning: Cannot open: Permission denied
|
|
-----
|
|
tar: directory: Cannot open: Permission denied
|
|
tar: Error exit delayed from previous errors
|
|
-----
|
|
tar: directory: Warning: Cannot open: Permission denied
|
|
])
|
|
|
|
AT_CLEANUP
|