Commit Graph

229 Commits

Author SHA1 Message Date
Paul Eggert
f31b9d842b Include <quotearg.h>.
(from_oct): Add forward decl.
(read_header): Return HEADER_FAILURE if we can't parse the checksum.
(from_oct): Report an error only if TYPE is nonzero.
Quote any funny characters in bad header.
1999-03-22 22:06:22 +00:00
Paul Eggert
13617c42d8 (to_oct): New parameter substitute, giving a substitute value to use
when the original value is out of range.  Do not append a space to the
output; modern tars don't.  When a value is out of range, specify the
maximum value, not the number of bits.
(GID_NOBODY, UID_NOBODY): New macros.
(gid_to_oct, uid_to_oct): Use them as substitutes.
(finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
(dump_file): Check whether the file changed as we read it.
1999-03-02 00:10:11 +00:00
Paul Eggert
00a2b4708f (main): Remove suspicious AIX/386 code. 1999-03-02 00:10:11 +00:00
Paul Eggert
545ec1a3fa (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct, off_from_oct,
size_from_oct, time_from_oct, uid_from_oct, uintmax_from_oct):
Use TYPE_MAXIMUM instead of macros like OFF_MAX, which are not reliable
(e.g. OFF_MAX in AIX 4.2 is incorrect).
1999-03-02 00:10:11 +00:00
Paul Eggert
f561403bad (long_options, usage): Prefer --unbzip2 to --bunzip2. 1999-02-20 06:04:28 +00:00
Paul Eggert
16368da655 Update copyright. 1999-02-01 08:10:25 +00:00
Paul Eggert
6ccb513321 (long_options, usage, OPTION_STRING, decode_options):
Add -y or --bzip2 or --bunzip2 option.
1999-02-01 07:51:19 +00:00
Paul Eggert
7381ee26dd (extract_archive): Fix bug when extracting sparse files: they were
trashing the tar file header.
1999-02-01 07:51:19 +00:00
Paul Eggert
2e4d78d856 (cached_no_such_uname, cached_no_such_gname, cached_no_such_uid,
cached_no_such_gid): New vars.
(uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
Cache failures, too.
1999-01-31 02:53:47 +00:00
Paul Eggert
562d543b2d (decode_options): Don't pass names longer than UNAME_FIELD_SIZE to
uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
1999-01-31 02:52:16 +00:00
Paul Eggert
5019d3b2d9 (backspace_output, close_archive): Cast rmtlseek position arg to off_t,
for benefit of K&R compilers with long long.
1999-01-28 00:28:41 +00:00
Paul Eggert
3ca6dbbb22 (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct): Cast value to uintmax_t, for
benefit of pre-ANSI compilers with long long.
1999-01-27 20:42:30 +00:00
Paul Eggert
c7f56e640d (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct):
Cast limit to uintmax_t, for
benefit of pre-ANSI compilers with long long.
1999-01-27 20:42:30 +00:00
Paul Eggert
e1ac06bcca (read_header): Accept file names as specified by POSIX.1-1996 section 10.1.1. 1998-12-07 22:36:22 +00:00
Paul Eggert
53a5ac41d2 (set_stat): chmod after chown even when not root; if we are using
--same-owner this is needed e.g. on Solaris 2.5.1.
1998-11-30 22:17:11 +00:00
Paul Eggert
b9ca9399a1 Don't use rexec code unless compiled with WITH_REXEC. On many
installations, rexec is disabled.
1998-10-29 02:22:34 +00:00
Paul Eggert
b21cfb5780 Ghostscript 6.0 1998-09-09 23:52:32 +00:00
Paul Eggert
887188311d (uid_to_uname, gid_to_gname): Don't used cached name for nameless
users and groups.
1998-08-07 19:09:15 +00:00
junio
4559fdbfb1 Implement -E (ending-file) option. 1997-12-04 07:07:11 +00:00
junio
d1f1e3a189 Implement -E (ending-file) option. 1997-12-04 06:37:52 +00:00
Paul Eggert
56569a0f75 (main): Don't assume mt_count is of type daddr_t. 1997-11-10 19:13:12 +00:00
Paul Eggert
48be206fbf (to_oct): Now static. Value arg is now uintmax_t. Accept new args
giving name of type of octal field, for error messages.  Report an
error if the value is too large to fit in the field.
(gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.

(write_eot, write_long, finish_header, deal_with_sparse,
finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
appropriate.  Remove now-useless casts.  Use unsigned long to print
*_t types, except use STRINGIFY_BIGINT for off_t.

(find_new_file_size): 1st arg is now off_t*.
(finish_sparse_file): Args now use off_t, not long.
Check for lseek error.
(create_archive, dump_file): Cast -1 to dev_t when necessary.
(dump_file): Device arg is now dev_t.
Avoid overflow when testing whether file has holes
by using the new ST_NBLOCKSIZE macro.
1997-10-31 00:58:55 +00:00
Paul Eggert
293c604c5d (rmt_read__, rmt_write__): Now returns ssize_t.
(rmt_lseek): Now returns off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
ac8cfdacf6 (record_start_block, save_totsize, save_sizeleft, real_s_totsize,
real_s_sizeleft, current_block_ordinal): Now off_t.
(write_error): Arg is now ssize_t.
(child_pid): Now pid_t.
(available_space_after): Now size_t.

(child_open_for_compress, child_open_for_uncompress, flush_write,
open_archive, flush_write, write_error, flush_read, close_archive):
Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
241bbee81b (read_and, list_archive, read_header, decode_mode, print_header,
print_for_mkdir): Use mode_t, off_t, size_t when appropriate.  Remove
now-useless casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.

(read_header): Check for overflow when converting header size.

(from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
const char *.  Size arg is now size_t.  Now takes new type and maxval
args.  Compute result using uintmax_t, not long.  Report error if
field does not contain octal number in range.
(gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
uintmax_from_oct): New functions.

(stringify_uintmax_t_backwards): New function.

(decode_mode, print_for_mkdir): Mode arg is now mode_t.
(skip_file): Offset arg is now off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
49086e2770 (newdir_umask, current_umask): Now mode_t.
(extract_sparse_file): Args now use off_t.

(set_mode, set_stat, make_directories, extract_sparse_file,
extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
now-useless casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
f3531f64fb (name_init): Fix typo in error message: FILE* was passed, but char*
was wanted.

(read_name_from_file, name_gather, addname, name_match, name_scan,
add_exclude): Use size_t when appropriate.  Remove now-useless casts.

(exclude_pool_size, allocated_exclude_pool_size): Now size_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
f2bad2db48 (extract_mangle): Check for overflow when converting off_t to size_t.
Use off_t, size_t when appropriate.  Remove now-useless casts.
1997-10-31 00:58:55 +00:00
Paul Eggert
dab18c15bd (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__): Use
pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
off_t.

(get_status_string, get_status_off): New function.
(get_status): Now returns long, so that it can store ssize_t.
Invoke get_status_string to do the real work.
(rmt_read__, rmt_write__): Now returns ssize_t.  Size arg is now size_t.
(rmt_lseek__): Now returns off_t, using new get_status_off function.
(rmt_ioctl__): Convert mt_count by hand, since it might be longer than long.
1997-10-31 00:58:55 +00:00
Paul Eggert
88ea940c0e (check_decimal): Now returns 1 if successful, 0 otherwise, and returns
uintmax_t value into new arg.  Check for arithmetic overflow.
(decode_options): Avoid overflow if record_size fits in size_t but not int.
Check for overflow on user or group ids.
1997-10-31 00:58:55 +00:00
Paul Eggert
ac65803ac9 (append_file) Use off_t, size_t, ssize_t when appropriate. Remove
now-useless casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
(update_archive): Cast -1 to dev_t when necessary.
1997-10-31 00:58:55 +00:00
Paul Eggert
998e6e081d (allocated_size): Now size_t, and now initialized to 0.
(prepare_record_buffer): Arg is now size_t.
Remove now-useless casts.

(main): Use `long' for status, so that it can store ssize_t.
Use daddr_t, mode_t, size_t, off_t when appropriate.
Convert daddr_t and off_t values ourselves, since they might be longer
than long.  Convert other types using `long' primitives.
When processing MTIOCTOP, do not try to pass resulting
count back, since it won't work (it could be too large) and it's
not expected anyway.
1997-10-31 00:58:55 +00:00
Paul Eggert
b7890ac757 GNU tar 1.12 1997-04-25 20:16:30 +00:00
Paul Eggert
5e0e89eac1 GNU tar 1.12 1997-04-25 20:09:49 +00:00
Paul Eggert
3e3d9b7e39 GNU tar 1.12 1997-04-25 17:10:08 +00:00
Paul Eggert
27e87f4f2f GNU tar 1.12 1997-04-25 13:48:46 +00:00
Paul Eggert
3728196fa6 GNU tar 1.12 1997-04-24 14:41:50 +00:00
Paul Eggert
70b61d565b GNU tar 1.12 1997-04-24 14:09:23 +00:00
Paul Eggert
76dce03c2e GNU tar 1.12 1997-04-24 02:25:57 +00:00
Paul Eggert
818c240503 GNU tar 1.12 1997-04-23 00:05:57 +00:00
Paul Eggert
be2c991f7b GNU tar 1.12 1997-04-22 06:31:03 +00:00
Paul Eggert
768c69b838 GNU tar 1.12 1997-04-22 05:35:50 +00:00
Paul Eggert
3bc4fa60f3 GNU tar 1.12 1997-04-20 02:43:34 +00:00
Paul Eggert
eed93f9a58 GNU tar 1.12 1997-04-19 22:44:12 +00:00
Paul Eggert
011a28be4d GNU tar 1.12 1997-04-18 16:36:06 +00:00
Paul Eggert
10797cd27b GNU tar 1.12 1997-04-18 02:44:58 +00:00
Paul Eggert
cee0eec6d2 GNU tar 1.12 1997-04-16 21:02:57 +00:00
Paul Eggert
a4f7f5bcc6 GNU tar 1.12 1997-04-15 20:34:49 +00:00
Paul Eggert
799e915cd3 GNU tar 1.12 1997-04-15 20:33:59 +00:00
Paul Eggert
63f2f45b88 tar 1.13 1997-04-15 20:32:54 +00:00