Paul Eggert [Mon, 27 Aug 2001 14:32:51 +0000 (14:32 +0000)]
(from_header): Do not issue a diagnostic if TYPE is zero.
However, check for error even for '-' or '+' case.
(print_header): Try parsing uids and gids as unsigned integers first,
and as a uid_t or gid_t only if that fails. This adds support for
listing positive uids and gids that are greater than UID_MAX and
GID_MAX.
Paul Eggert [Mon, 27 Aug 2001 14:27:54 +0000 (14:27 +0000)]
(struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
Support hard links to symbolic links.
(struct delayed_symlink): Remove 'names' member, replacing it with
'sources' and 'target' member. All uses changed.
(struct string_list): New type.
(delayed_set_stat, extract_archive): Use offsetof when computing sizes
for struct hack; this avoids wasted space in some cases.
(extract_archive): Fix test for absolute pathnames and/or "..".
Use link_error to report errors for links.
Remove redundant trailing '/' at "really_dir", for all uses, not
just before invoking mkdir.
If overwriting old files, do not worry so much about existing directories.
Fix mode computation in the case where the directory exists.
(apply_delayed_symlinks): If we can't make a hard link to a symbolic
link, make a copy of the symbolic link.
Paul Eggert [Mon, 27 Aug 2001 00:02:27 +0000 (00:02 +0000)]
Put leading '*' in direntry.
Accommodate new gfdl sectioning.
New option --recursion (the default) that is the inverse of --no-recursion.
New options --anchored, --ignore-case, --wildcards,
--wildcards-match-slash, and their negations (e.g., --no-anchored).
Along with --recursion and --no-recursion, these control how exclude
patterns are interpreted. The default interpretation of exclude
patterns is now --no-anchored --no-ignore-case --recursion
--wildcards --wildcards-match-slash.
Paul Eggert [Sat, 13 Jan 2001 06:04:48 +0000 (06:04 +0000)]
Add @setchapternewpage odd.
Remove -I as an alias for -T, for now.
Add @dircategory.
Update copyright. Remove "Published by".
Dates beginning with / or . are taken to be file names.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(time): Do not declare.
(usage): Remove -I as an alias for -T>
(OPTION_STRING): Remove -I.
(decode_options): Dates that look like an absolute path name,
or that start with '.', are presumed to be file names whose
dates are taken.
Remove 'I' as an aliase for 'T'.
Update copyright.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(relativize): New function.
> (relativize): New function, with much of old start_header's guts.
Handle filesystem prefixes.
(start_header): Use this new function.
(init_sparsearray): Don't bother to zero out the new array; it's not needed.
(deal_with_sparse): Fix array allocation bug.
(create_archive): Don't assume '/' is the only separator.
(dump_file): Likewise.
Don't worry about leading / in symlink targets.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(name_next): Don't assume '/' is the only directory separator.
(namelist_match): Likewise.
(add_hierarchy_to_namelist): Remove dirsize arg.
Do not assume '/' is the only directory separator.
(new_name): Likewise.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(<time.h>): Do not include; system.h now does this.
(time): Remove decl; likewise.
(child_open_for_uncompress): Use new full_write semantics.
(flush_write): Use ISSLASH instead of testing for '/'.
(flush_read): Likewise.
Paul Eggert [Sat, 13 Jan 2001 05:59:29 +0000 (05:59 +0000)]
(<time.h>): Do not include; system.h now does this.
(make_directories): Skip filesystem prefixes.
Don't assume '/' is the only separator.
(extract_sparse_file): Use new full_write semantics.
On write error, return instead of invoking skip_file.
Do not free sparsearray; caller does this now.
(apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
separator.
(extract_archive): Don't assume file name lengths fit in int.
Report what got stripped from member name; it might be more than '/'.
Use new full_write semantics.
Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
mkdir to ignore it.
Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
Paul Eggert [Sun, 29 Oct 2000 05:30:02 +0000 (05:30 +0000)]
(NO_RECURSE_OPTION): Remove.
(long_options): Have getopt set the --no-recursion flag.
(decode_options): Initialize recursion_option to FNM_LEADING_DIR.
Remove case for NO_RECURSE_OPTION.
Paul Eggert [Wed, 25 Oct 2000 05:21:06 +0000 (05:21 +0000)]
(check_label_pattern): Make sure header name is a string before
passing it to fnmatch.
(init_volume_number): Check for global_volno overflow.
(new_volume): Check for global_volno overflow.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
New file, taken from fileutils 4.0.27, with the
following changes: Use @sc where appropriate. Document the ranges of
supported times more precisely. Add Eggert to getdate authors.
Document old Latin 12m/12pm tradition. Remove list of alphabetic time
zone names, as it wasn't correct and people shouldn't be relying on it
anyway. Relative items also account for non-DST adjustments. Fix
some misspellings.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
Include localedir.h, prepargs.h.
(long_options): Now static.
(long_options, usage, decode_options): -j is now short for --bzip2,
and -I is now an alias for -T.
(decode_options, main): argv is not const pointer now.
(decode_options): Invoke prepend_default_options to support TAR_OPTIONS.
In diagnostic, mention the string that was the invalid blocking factor,
tape length, group, owner, or record size.
--delete is no longer incompatible with -f -, undoing 2000-01-07 change.
(main): Invoke extract_finish at end of extraction.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
Include hash.h.
(gnu_list_name): Remove decl.
(struct link): Remove "next" member.
(linklist): Remove.
(start_header): Say "leading `FOO'" rather than "`FOO' prefix" for consistency
with other diagnostics.
(deal_with_sparse): Check for I/O error when closing the file.
(create_archive):
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
(hash_link, compare_links): New functions.
(dump_file): Do not exhaust open file descriptors when descending deeply
into a directory, by using savedir rather than opendir/readdir.
Do not zero-fill the name buffer unnecessarily.
Hash the set of links already created, instead of using a linked list.
Fix some bugs in outputting sparse files which caused the sparse tables
to be incorrect.
When a file unexpectedly shrinks, output zeros rather than garbage.
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
Add Free Documentation License. New section
"Overwrite Old Files", and revamp that section to make it easier to
follow. "tar" -> "GNU tar" where appropriate. Migrate getdate
documentation into getdate.texi. Fix several minor typos. Describe
TAR_OPTIONS. Describe incompatibility between incremental backups and
--atime-preserve. Describe incompatibility between --verify and other
options. Mention that tar normally removes symbolic links rather than
following them, when extracting a file of the same name.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
(we_are_root): Now global.
(struct delayed_symlink): New type.
(delayed_symlink_head): New var.
(extr_init, fatal_exit):
Invoke extract_finish on fatal errors, not apply_delayed_set_stat.
(set_mode, set_stat): Pointer args are now const pointers.
(check_time): New function.
(set_stat): Warn if setting a file's timestamp to be the future.
(make_directories): Do not save and restore errno.
(maybe_recoverable): Set errno to ENOENT if we cannot make missing
intermediate directories.
(extract_archive):
Invoke apply_nonancestor_delayed_set_stat here, not in caller.
Extract potentially dangerous symbolic links more carefully, deferring their
creation until the end, and using a regular file placeholder in the meantime.
Do not remove trailing / and /. from file names.
Do not bother checking for ".." when checking whether a directory
loops back on itself, as loopbacks can occur with symlinks too.
Also, in that case, do not bother saving and restoring errno; just
set it to EEXIST.
(apply_nonancestor_delayed_set_stat): A prefix is a potential ancestor if
it ends in slash too (as well as ending in a char just before slash).
(apply_delayed_set_stat): Remove.
(apply_delayed_symlinks, extract_finish): New functions.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
(read_and):
Do not invoke apply_nonancestor_delayed_set_stat;
DO_SOMETHING is now responsible for that.
Do not invoke apply_delayed_set_stat; our caller is now responsible for that.
(read_header): Use signed char instead of signed_char.
Prevent later references to current_header from
mistakenly treating it as an old GNU header.
(from_header): Quote invalid base-64 strings in diagnostics.
(time_from_header): Do not warn about future timestamps in archive;
check_time now does that.
(tartime): Fix off-by-one error when copying year if OLD_CTIME.
(print_header): Quote unknown file types.
(skip_member): New function, replacing skip_extended_headers and
now skipping the whole member instead of just the extended headers.
All callers changed. This makes the code handle extended headers
uniformly, and fixes some bugs.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
(base_name): Do not include basename.h; declare base_name
instead.
(rexec): Don't declare unless using it.
(do_command): Simplify signal-handling code slightly.
Paul Eggert [Tue, 24 Oct 2000 06:18:37 +0000 (06:18 +0000)]
(_GNU_SOURCE): Remove; autoconf now does this.
(child_open_for_compress, child_open_for_uncompress, close_archive):
Propagate any failure of the compression process back to "tar".
(open_archive, flush_write, flush_read, close_archive):
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
(open_archive): Don't bother checking S_ISCHR of /dev/null.
(backspace_output): Don't try to backspace past start of archive.
(close_archive): Remove special case for DELETE_SUBCOMMAND.