]> git.ipfire.org Git - thirdparty/tar.git/log
thirdparty/tar.git
8 months agoPrefer idx_t to size_t in system.c
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Prefer idx_t to size_t in system.c

* src/buffer.c (_flush_write): Return idx_t, not ssize_t,
to accommodate system.c changes.  All uses changed.
(_gnu_flush_write): Output correct errno value after write error.
Simplify multi-volume mode.
* src/system.c (sys_write_archive_buffer)
(sys_child_open_for_compress, sys_exec_setmtime_script):
Prefer idx_t to size_t.

8 months agoStreamline compression suffix detection
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Streamline compression suffix detection

* src/suffix.c (struct compression_suffix):
Use arrays rather than pointers that need relocation.
All uses changed.
(compression_suffixes): Now const.
Omit trailing null entry; all uses changed.
(find_compression_suffix): Simplify length calculations.
No longer any need to call strlen.

8 months agoFewer uses of size_t in suffix.c
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Fewer uses of size_t in suffix.c

* src/suffix.c (struct compression_suffix)
(find_compression_suffix, set_compression_program_by_suffix)
(strip_compression_suffix): Prefer idx_t to size_t.

8 months agoFewer uses of size_t in sparse.c
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Fewer uses of size_t in sparse.c

* src/sparse.c (struct tar_sparse_optab, dump_zeros)
(tar_sparse_dump_region, tar_sparse_extract_region)
(zero_block_p, sparse_add_map, sparse_dump_region)
(sparse_extract_region, sparse_dump_file, sparse_extract_file)
(check_data_region, sparse_diff_file, oldgnu_get_sparse_info)
(oldgnu_store_sparse_info, oldgnu_dump_header)
(star_get_sparse_info, pax_dump_header_0):
Prefer idx_t to size_t.

8 months agoAdjust better to Gnulib signed-int read changes
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Adjust better to Gnulib signed-int read changes

The 2024-08-09 Gnulib changes that caused some modules prefer
signed types to size_t means that Tar should follow suit.
* src/buffer.c (short_read):
* src/system.c (sys_child_open_for_compress)
(sys_child_open_for_uncompress):
rmtread and safe_read return ptrdiff_t not idx_t;
don’t rely on implementation defined conversion.
* src/misc.c (blocking_read): Never return a negative number.
Return idx_t, not ptrdiff_t, with the same convention for EOF
and error as the new full_read.  All callers changed.
* src/sparse.c (sparse_dump_region, check_sparse_region)
(check_data_region):
* src/update.c (append_file):
full_read no longer returns SAFE_READ_ERROR for I/O error; instead it
returns the number of bytes successfully read, and sets errno.
Adjust to this.
* src/system.c (sys_child_open_for_uncompress):
Rewrite to avoid need for goto and label.

8 months agoSimplify name_buffer initialization
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Simplify name_buffer initialization

* src/names.c (name_init): Remove no-longer-needed initialization
of name_buffer, name_buffer_length.  It was confusing anyway,
since it caused name_buffer_length to not equal the length of
name_buffer.

8 months agoSimplify add_hierarchy_to_namelist allocation
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Simplify add_hierarchy_to_namelist allocation

* src/names.c (add_hierarchy_to_namelist):
Use xpalloc rather than a complicated homebrew heuristic.

8 months agoRemove xattrs_clear_setup
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Remove xattrs_clear_setup

It’s never actually called.
* src/xattrs.c (clear_mask_map, xattrs_clear_setup):
Remove.  All uses removed.

8 months agoRemove name_term
Paul Eggert [Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)] 
Remove name_term

It’s never actually called.
* src/names.c (name_term): Remove.  All uses removed.

8 months agoDiagnose sys_exec_info_script failures
Paul Eggert [Fri, 1 Nov 2024 16:39:33 +0000 (09:39 -0700)] 
Diagnose sys_exec_info_script failures

* src/system.c (sys_exec_info_script): Diagnose failures in
getline, fclose.  Don’t worry about freeing memory
as caller will immediately exit anyway.

8 months agoPacify GCC in info_attach_exclist
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Pacify GCC in info_attach_exclist

* src/exclist.c (info_attach_exclist): Remove unnecessary test
for whether dir and ex are null.  GCC complains about the first
one in some cases.  Use C99-style decls.

8 months agoFewer uses of size_t in names.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in names.c

* src/names.c (name_buffer_length, read_name_from_file)
(copy_name, all_names_found, add_hierarchy_to_namelist)
(rebase_child_list, make_file_name, stripped_prefix_len):
Prefer idx_t to size_t.

8 months agoFewer uses of size_t in misc.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in misc.c

* src/misc.c (assign_string_n, quote_copy_string)
(normalize_filename, replace_prefix, remove_any_file)
(blocking_read, wd_alloc, wdcache_count, chdir_arg, chdir_do)
(read_diag_details, struct namebuf, namebuf_name):
Prefer idx_t to size_t.

8 months agoFewer uses of size_t in list.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in list.c

* src/list.c (recent_long_name_blocks, recent_long_link_blocks)
(read_header, from_header, gid_from_header, major_from_header)
(minor_from_header, mode_from_header, off_from_header)
(time_from_header, uid_from_header, uintmax_from_header)
(tartime): Prefer idx_t to size_t.

8 months agoFewer uses of size_t in incremen.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in incremen.c

* src/incremen.c (struct dumpdir, dumpdir_create0, struct dumpdir_iter)
(dumpdir_next, dumpdir_size, make_directory)
(dirlist_replace_prefix, rebase_directory, makedumpdir)
(maketagdumpdir, append_incremental_renames, read_obstack)
(read_incr_db_2, get_gnu_dumpdir, try_purge_directory)
(list_dumpdir): Prefer idx_t to size_t.

8 months agoFewer uses of size_t in extract.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in extract.c

* src/extract.c (struct delayed_set_stat, struct delayed_link)
(delay_set_stat, apply_nonancestor_delayed_set_stat)
(extract_file): Prefer idx_t to size_t.
(struct delayed_set_stat): Remove unused member xattr_map_size.

8 months agoFewer uses of size_t in exclist.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in exclist.c

* src/exclist.c (hg_addfn): Prefer idx_t to size_t.

8 months agoFewer uses of size_t in delete.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in delete.c

* src/delete.c (write_recent_blocks, write_recent_bytes):
Prefer idx_t to size_t.

8 months agoFewer uses of size_t in create.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in create.c

* src/create.c (struct exclusion_tag, to_octal, tar_copy_str)
(tar_name_copy_str, to_base256, to_chars_subst, to_chars)
(gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars)
(off_to_chars, time_to_chars, uid_to_chars, uintmax_to_chars)
(string_to_chars, start_private_header, write_gnu_long_link)
(split_long_name, write_ustar_long_name, simple_finish_header)
(dump_dir0, ensure_slash, create_archive):
Prefer idx_t to size_t.

8 months agoFewer uses of size_t in compare.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in compare.c

* src/compare.c (read_and_process): Prefer idx_t to size_t.

8 months agoSimplify checkpoint_action allocation
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Simplify checkpoint_action allocation

* src/checkpoint.c: Include <flexmember.h>.
(struct checkpoint_action): New member commandbuf.
(checkpoint_action_tail): Now pointer to pointer,
to simplify updating.  All uses changed.
(alloc_action): New arg quoted_string, to lessen number of
separate allocations.  All uses changed.

8 months agocheckpoint_total_format is now const
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
checkpoint_total_format is now const

* src/checkpoint.c (checkpoint_total_format):
Now const, and local to format_checkpoint_string.

8 months agoFewer uses of size_t in checkpoint.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in checkpoint.c

* src/checkpoint.c (copy_string_unquote, getarg)
(format_checkpoint_string): Prefer idx_t to size_t.
(copy_string_unquote): Simplify by using ximemdup0.
(getarg): Avoid quadratic reallocation behavior by
using xpalloc.

8 months agoFewer uses of size_t in buffer.c
Paul Eggert [Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)] 
Fewer uses of size_t in buffer.c

* src/buffer.c (flush_write_ptr, flush_bufmap, bufmap_locate):
(struct zip_magic, available_space_after, _flush_write)
(short_read, flush_archive, try_new_volume)
(gnu_add_multi_volume_header, simple_flush_read)
(simple_flush_write, _gnu_flush_read, _gnu_flush_write)
(gnu_flush_write): Prefer idx_t to size_t when either will do, as
signed types are typically safer.  For a tiny value in memory,
just use ‘char’.

8 months agoDon't assume archive read from stdin starts at offset 0
Sergey Poznyakoff [Thu, 31 Oct 2024 17:09:28 +0000 (19:09 +0200)] 
Don't assume archive read from stdin starts at offset 0

* src/buffer.c (start_offset): New variable.
(get_archive_status): If reading from seekable stdin, store the
position in the stream corresponding to record_start in start_offset.
(seek_archive): Compute current offset relative to start_offset.

9 months agoAdd missing safety check
Sergey Poznyakoff [Fri, 25 Oct 2024 10:40:32 +0000 (13:40 +0300)] 
Add missing safety check

* src/system.c (sys_exec_info_script): Check if fdopen succeded.
Fix by Matteo Croce.

9 months agoRemove useless check
Sergey Poznyakoff [Fri, 25 Oct 2024 07:24:32 +0000 (10:24 +0300)] 
Remove useless check

* src/exclist.c (info_attach_exclist): Don't check whether dir
is NULL. It can't be.

9 months agoBugfix
Sergey Poznyakoff [Fri, 25 Oct 2024 06:50:22 +0000 (09:50 +0300)] 
Bugfix

This fixes an extra argument left over in a function call by commit
0dfcfa4aa4.  Reported by Matteo Croce.

* src/buffer.c (_open_archive): Fix extra argument to paxfatal.

11 months agoFewer macros in xheader.c
Paul Eggert [Mon, 19 Aug 2024 16:56:25 +0000 (09:56 -0700)] 
Fewer macros in xheader.c

* src/xheader.c (HEADER_TEMPLATE):
Remove.  All uses replaced with definiens.
(XHDR_PROTECTED, XHDR_GLOBAL): Now constants, not macros.

11 months agoFewer macros in xattrs.c
Paul Eggert [Mon, 19 Aug 2024 16:55:32 +0000 (09:55 -0700)] 
Fewer macros in xattrs.c

* src/xattrs.c (XATTRS_PREFIX, XATTRS_PREFIX_LEN, USER_DOT_PFX):
Now constants, not macros.

11 months agoFewer macros in unlink.c
Paul Eggert [Mon, 19 Aug 2024 16:54:15 +0000 (09:54 -0700)] 
Fewer macros in unlink.c

* src/unlink.c (IS_CWD): Now a (lower-cased) function.

11 months agoFewer macros in transform.c
Paul Eggert [Mon, 19 Aug 2024 16:53:35 +0000 (09:53 -0700)] 
Fewer macros in transform.c

* src/transform.c (CASE_CTL_RESET): Remove, replacing with one
instance of code (with a goto, alas).  Still a bit clearer, I think.

11 months agoFewer macros in tar.c
Paul Eggert [Mon, 19 Aug 2024 16:52:39 +0000 (09:52 -0700)] 
Fewer macros in tar.c

* src/tar.c (FORMAT_MASK, TAR_SIZE_SUFFIXES, SUBCL_READ)
(SUBCL_WRITE, SUBCL_UPDATE, SUBCL_TEST, SUBCL_OCCUR)
(IS_SUBCOMMAND_CLASS, NS_PRECISION_FORMAT_MASK):
Now constants or (lower-cased) functions, not macros.
(subcommand_class):
Replace hopeful comments with code implementing them.

11 months agoFewer macros in tar.h
Paul Eggert [Mon, 19 Aug 2024 16:50:02 +0000 (09:50 -0700)] 
Fewer macros in tar.h

* src/tar.h (REGTYPE, AREGTYPE, SYMTYPE, BLKTYPE, FIFOTYPE)
(XHDTYPE, XGLTYPE, TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC)
(TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC)
(SPARSES_IN_EXTRA_HEADER, SPARSES_IN_OLDGNU_HEADER)
(SPARSES_IN_SPARSE_HEADER, GNUTYPE_DUMPDIR, GNUTYPE_LONGLINK)
(GNUTYPE_LONGNAME, GNUTYPE_MULTIVOL, GNUTYPE_SPARSE)
(GNUTYPE_VOLHDR, SOLARIS_XHDTYPE, SPARSES_IN_STAR_HEADER)
(SPARSES_IN_STAR_EXT_HEADER, BLOCKSIZE):
Now constants, not macros.

11 months agoFewer macros in system.c
Paul Eggert [Mon, 19 Aug 2024 16:48:07 +0000 (09:48 -0700)] 
Fewer macros in system.c

* src/system.c (PREAD, PWRITE): Now constants, not macros.

11 months agoFewer macros in names.c
Paul Eggert [Mon, 19 Aug 2024 16:47:11 +0000 (09:47 -0700)] 
Fewer macros in names.c

* src/names.c (EXCLUDE_OPTIONS, INCLUDE_OPTIONS):
Now (lowercased) functions, not macros.
(SUCCESSOR): Remove, replacing uses with definiens.

11 months agoFewer macros in incremen.c
Paul Eggert [Mon, 19 Aug 2024 16:45:43 +0000 (09:45 -0700)] 
Fewer macros in incremen.c

* src/incremen.c (DIRF_INIT, DIRF_NFS, DIRF_FOUND, DIRF_NEW)
(DIRF_RENAMED, DIR_IS_INITED, DIR_IS_NFS, DIR_IS_FOUND)
(DIR_IS_RENAMED, DIR_SET_FLAG, DIR_CLEAR_FLAG, NFS_FILE_STAT)
(PD_FORCE_CHILDREN, PD_FORCE_INIT, PD_CHILDREN)
(TAR_INCREMENTAL_VERSION, TEMP_DIR_TEMPLATE):
Now constants or (lowercased) functions, not macros.
(ST_DEV_MSB) [!HAVE_ST_FSTYPE_STRING]: Remove.
Replace only use with something simpler.

11 months agoFewer macros in extract.c
Paul Eggert [Mon, 19 Aug 2024 16:42:59 +0000 (09:42 -0700)] 
Fewer macros in extract.c

* src/extract.c (ALL_MODE_BITS, RECOVER_NO, RECOVER_OK)
(RECOVER_SKIP): Now constants or inline functions, not macros.
(maybe_recoverable): Return enum recover, not int.

11 months agoFewer macros in create.c
Paul Eggert [Mon, 19 Aug 2024 16:41:37 +0000 (09:41 -0700)] 
Fewer macros in create.c

* src/create.c (CACHEDIR_SIGNATURE, CACHEDIR_SIGNATURE_SIZE)
(MAX_VAL_WITH_DIGITS, MAX_OCTAL_VAL): Now constants or
inline functions or removed, instead of macros.
(max_octal_val): Accept size rather than type.

11 months agoFewer macros in buffer.c
Paul Eggert [Mon, 19 Aug 2024 16:39:37 +0000 (09:39 -0700)] 
Fewer macros in buffer.c

* src/buffer.c (READ_ERROR_MAX, NMAGIC, VOL_SUFFIX):
Now constants rather than macros.  Rename NMAGIC to n_zip_magic.

11 months agoFewer macros in common.h
Paul Eggert [Mon, 19 Aug 2024 16:12:52 +0000 (09:12 -0700)] 
Fewer macros in common.h

In common.h, replace macros with constants or functions when that
is easy.  This makes code a bit more reliable (functions evaluate
their args exactly once) and easier to debug (many debugging
environments cannot access macros).
* src/common.h (CHKBLANKS): Remove.  All uses removed.
(NAME_FIELD_SIZE, PREFIX_FIELD_SIZE, UNAME_FIELD_SIZE)
(GNAME_FIELD_SIZE, TAREXIT_SUCCESS, TAREXIT_DIFFERS)
(TAREXIT_FAILURE, LG_8, LG_256, DEFAULT_CHECKPOINT)
(MAX_OLD_FILES, TF_READ, TF_WRITE, TF_DELETED, XFORM_REGFILE)
(XFORM_LINK, XFORM_SYMLINK, XFORM_ALL, WARN_ALONE_ZERO_BLOCK)
(WARN_BAD_DUMPDIR, WARN_CACHEDIR, WARN_CONTIGUOUS_CAST)
(WARN_FILE_CHANGED, WARN_FILE_IGNORED, WARN_FILE_REMOVED)
(WARN_FILE_SHRANK, WARN_FILE_UNCHANGED, WARN_FILENAME_WITH_NULS)
(WARN_IGNORE_ARCHIVE, WARN_IGNORE_NEWER, WARN_NEW_DIRECTORY)
(WARN_RENAME_DIRECTORY, WARN_SYMLINK_CAST, WARN_TIMESTAMP)
(WARN_UNKNOWN_CAST, WARN_UNKNOWN_KEYWORD, WARN_XDEV)
(WARN_DECOMPRESS_PROGRAM, WARN_EXISTING_FILE, WARN_XATTR_WRITE)
(WARN_RECORD_SIZE, WARN_FAILED_READ, WARN_MISSING_ZERO_BLOCKS)
(WARN_VERBOSE_WARNINGS, WARN_ALL, EXCL_DEFAULT, EXCL_RECURSIVE)
(EXCL_NON_RECURSIVE): Now enum constants rather than macros.
(time_option_initialized, isfound, wasfound, warning_enabled):
Now functions rather than macros TIME_OPTION_INITIALIZED, ISFOUND,
WASFOUND, WARNING_ENABLED.  All uses changed.
(OLDER_STAT_TIME, OLDER_TAR_STAT_TIME, EXTRACT_OVER_PIPE)
(TAR_ARGS_INITIALIZER): Remove.  All uses replaced with their
definiens or equivalent.

11 months agoFix non-ASCII in sparse.c
Paul Eggert [Mon, 19 Aug 2024 05:40:43 +0000 (22:40 -0700)] 
Fix non-ASCII in sparse.c

11 months agoPrefer function to COPY_BUF macro
Paul Eggert [Sun, 18 Aug 2024 18:02:51 +0000 (11:02 -0700)] 
Prefer function to COPY_BUF macro

* src/sparse.c (struct ok_n_block_ptr): New type.
(decode_num): Revamp API so that it does the work of both
the old decode_num and the old COPY_BUF.  Always read to the
next newline even if there is a lot of junk in between.
(pax_decode_header): Use the new API.
(COPY_BUF): Remove.

11 months agoPrefer function to COPY_STRING macro
Paul Eggert [Sun, 18 Aug 2024 16:44:25 +0000 (09:44 -0700)] 
Prefer function to COPY_STRING macro

* src/sparse.c (struct block_ptr):
New type, to allow a functional style.
(dump_str_nl, floorlog10): New static functions.
(COPY_STRING): Remove.  All uses replaced by dump_str_nl.
(pax_dump_header_1): Use floorlog10 instead of creating a string.
Simplify size calculation.

11 months agoFix string size bound calculation
Paul Eggert [Sun, 18 Aug 2024 15:45:41 +0000 (08:45 -0700)] 
Fix string size bound calculation

* src/common.h (UINTMAX_STRSIZE_BOUND):
Fix typo that luckily didn’t break anything.

11 months agomaint: switch from ERROR to paxerror etc
Paul Eggert [Sun, 18 Aug 2024 01:16:16 +0000 (18:16 -0700)] 
maint: switch from ERROR to paxerror etc

Prefer functions like ‘paxerror’ to macros like ‘ERROR’.
The functions have cleaner semantics, and calls are
easier to read.

11 months agobuild: update gnulib and paxutils submodules to latest
Paul Eggert [Sun, 18 Aug 2024 00:56:29 +0000 (17:56 -0700)] 
build: update gnulib and paxutils submodules to latest

11 months agoAdjust to verror change for program name
Paul Eggert [Thu, 15 Aug 2024 17:24:15 +0000 (10:24 -0700)] 
Adjust to verror change for program name

* configure.ac (ENABLE_ERROR_PRINT_PROGNAME):
Adjust to match new Gnulib behavior.

11 months agobuild: update gnulib and paxutils submodules to latest
Paul Eggert [Thu, 15 Aug 2024 05:21:12 +0000 (22:21 -0700)] 
build: update gnulib and paxutils submodules to latest

11 months agoFix duplicate write_error_details decl
Paul Eggert [Thu, 15 Aug 2024 06:07:14 +0000 (23:07 -0700)] 
Fix duplicate write_error_details decl

* src/common.h (write_error_details): Remove decl
that belongs to paxutils.

11 months agoFix minor diagnostic discrepancies in incrementals
Paul Eggert [Thu, 15 Aug 2024 06:05:33 +0000 (23:05 -0700)] 
Fix minor diagnostic discrepancies in incrementals

* src/incremen.c (read_directory_file, get_gnu_dumpdir):
Be more consistent about fatal errors.

11 months agoAdd verror module
Paul Eggert [Thu, 15 Aug 2024 06:01:57 +0000 (23:01 -0700)] 
Add verror module

* gnulib.modules: Add verror; paxlib will need this.

11 months agoUse idx_t for write_fatal_details size
Paul Eggert [Thu, 15 Aug 2024 05:19:30 +0000 (22:19 -0700)] 
Use idx_t for write_fatal_details size

* src/buffer.c (write_fatal_details): Prefer idx_t to size_t
for object size.

11 months agoUse intmax_t for read_incr_db_01 line numbers
Paul Eggert [Tue, 13 Aug 2024 15:39:25 +0000 (08:39 -0700)] 
Use intmax_t for read_incr_db_01 line numbers

* src/incremen.c (read_incr_db_01): Don’t assume line numbers
are less than LONG_MAX.

11 months agoAvoid need for base64_init and extra table
Paul Eggert [Tue, 13 Aug 2024 15:35:24 +0000 (08:35 -0700)] 
Avoid need for base64_init and extra table

Simplify the code by assuming C99 initializers.
* src/list.c (base_64_digits): Remove.
(base64_map): Now a constant.  Now has its (old value + 1) % 65,
as that’s the only easy portable way to do it with a static
initializer (even on platforms where CHAR_BIT != 8); all uses changed.
(base64_init): Remove; only use removed.
(from_header): Adjust to new values in base64_map.

* src/list.c (base_64_digits): Remove; no longer needed.
(base64_map): Now const, initialized statically, and with
invalid entries being 0 not 64, and with valid entries
being 1 greater than before.

11 months agoRemove cast from from_header
Paul Eggert [Tue, 13 Aug 2024 06:26:41 +0000 (23:26 -0700)] 
Remove cast from from_header

* src/list.c (from_header): Reword to avoid a cast
to unsigned char.

11 months agoPrefer signed to unsigned when decoding options
Paul Eggert [Tue, 13 Aug 2024 01:17:58 +0000 (18:17 -0700)] 
Prefer signed to unsigned when decoding options

* src/tar.c (assert_format, decode_options):
Prefer signed to unsigned integers.
(optloc_save): Prefer enum to unsigned integer.
Simplify allocation.
(decode_options): No need to call ngettext for a value known
to be plenty large.

11 months agoDon’t assume pid fits in unsigned long
Paul Eggert [Tue, 13 Aug 2024 01:04:42 +0000 (18:04 -0700)] 
Don’t assume pid fits in unsigned long

* src/system.c (sys_wait_command): Convert pid_t to intmax_t,
not to unsigned long.

11 months agoAvoid casts in tar_checksum
Paul Eggert [Tue, 13 Aug 2024 00:52:09 +0000 (17:52 -0700)] 
Avoid casts in tar_checksum

* src/list.c (tar_checksum, from_header):
Recode to avoid casts.

11 months agoSupport >UINT_MAX lines in map files
Paul Eggert [Tue, 13 Aug 2024 00:47:26 +0000 (17:47 -0700)] 
Support >UINT_MAX lines in map files

* src/map.c (parse_id, map_read): Prefer intmax_t to unsigned
for line numbers.

11 months agoPrefer signed integer in struct directory
Paul Eggert [Tue, 13 Aug 2024 00:45:03 +0000 (17:45 -0700)] 
Prefer signed integer in struct directory

* src/incremen.c (struct directory):
Prefer int to unsigned where either will do.

11 months agoSimplify make_directory via xizalloc
Paul Eggert [Tue, 13 Aug 2024 00:43:15 +0000 (17:43 -0700)] 
Simplify make_directory via xizalloc

* src/incremen.c (make_directory): Simplify by using
xizalloc instead of explicit initialization.

11 months agoUse idx_t, not size_t, for xattr value lengths.
Paul Eggert [Tue, 13 Aug 2024 00:39:21 +0000 (17:39 -0700)] 
Use idx_t, not size_t, for xattr value lengths.

* src/tar.h (struct xattr_map):
* src/xattrs.c (xattr_map_add): Prefer idx_t to size_t.  All uses
changed.

11 months agoUse intmax_t, not size_t, for input line numbers
Paul Eggert [Mon, 12 Aug 2024 23:18:16 +0000 (16:18 -0700)] 
Use intmax_t, not size_t, for input line numbers

This works better on platforms where SIZE_MAX < OFF_MAX.
* src/common.h (struct common locus):
* src/names.c (struct name_elt):
Use intmax_t for line numbers.  All uses changed.

11 months agoIn short_read, use %td not %lu
Paul Eggert [Mon, 12 Aug 2024 23:10:16 +0000 (16:10 -0700)] 
In short_read, use %td not %lu

* src/buffer.c (short_read): Don’t assume sizes fit
in unsigned long.

11 months agoPrefer signed types in blocking_read etc
Paul Eggert [Fri, 9 Aug 2024 07:22:53 +0000 (00:22 -0700)] 
Prefer signed types in blocking_read etc

* src/compare.c (process_noop, process_rawdata):
Return bool, not int.
* src/compare.c (process_noop, process_rawdata):
* src/create.c (dump_regular_file):
* src/extract.c (extract_file):
* src/misc.c (blocking_read, blocking_write):
* src/sparse.c (sparse_scan_file_raw, sparse_extract_region):
Prefer signed types like idx_t to unsigned ones like size_t.
(sparse_scan_file_raw): Diagnose read errors.

11 months agoFix minor integer overflow in xsparse.c
Paul Eggert [Thu, 8 Aug 2024 23:38:28 +0000 (16:38 -0700)] 
Fix minor integer overflow in xsparse.c

* scripts/xsparse.c (read_xheader):
Don’t assume size_t fits in unsigned.
Make the version numbers off_t, not just unsigned.

11 months agoPrefer stoint to strtoul and variants
Paul Eggert [Thu, 8 Aug 2024 23:32:49 +0000 (16:32 -0700)] 
Prefer stoint to strtoul and variants

When parsing numbers prefer using strtosysint (renamed stoint)
to using strtoul and its variants.
This is simpler and faster and likely more reliable than
relying on quirks of the system strtoul etc,
and it standardizes how tar deals with parsing integers.
Among other things, the C standard and POSIX don’t specify
what strtol does to errno when conversions cannot be performed,
and it requires strtoul to support "-" before unsigned numbers.
* gnulib.modules (strtoimax, strtol, strtoumax, xstrtoimax):
Remove.
* src/checkpoint.c (checkpoint_compile_action, getwidth)
(format_checkpoint_string):
* src/incremen.c (read_incr_db_01, read_num)
* src/map.c (parse_id):
* src/misc.c (decode_timespec):
* src/sparse.c (decode_num):
* src/tar.c (parse_owner_group, parse_opt):
* src/transform.c (parse_transform_expr):
* src/xheader.c (decode_record, decode_signed_num)
(sparse_map_decoder):
Prefer stoint to strtol etc.
Don’t rely on errno == EINVAL as the standards don’t guarantee it.
* src/checkpoint.c (getwidth, format_checkpoint_string):
Check for invalid string suffix.
* src/checkpoint.c (getwidth):
Return intmax_t, not long.  All callers changed.
* src/incremen.c (read_directory_file):
It’s just a one-digit number, so just subtract '0'.
* src/map.c (parse_id): Return bool not int.  All callers changed.
* src/misc.c (stoint): Rename from strtosysint, and add
a bool * argument for reporting overflow.  All callers changed.
(decode_timespec): Simplify by using ckd_sub rather than
checking for overflow by hand.
* src/tar.c (incremental_level): Now signed char to
emphasize that it can be only -1, 0, 1.  All uses changed.
* src/xheader.c (decode_record): Avoid giant diagnostics.

11 months agoHandle enormous record sizes better
Paul Eggert [Thu, 8 Aug 2024 17:51:39 +0000 (10:51 -0700)] 
Handle enormous record sizes better

Formerly the code could misbehave when the user specified a record
size greater than min (INT_MAX * 512 + 511, PTRDIFF_MAX, SSIZE_MAX).
* src/delete.c (new_blocks, delete_archive_members):
* src/system.c (sys_exec_info_script):
* src/tar.c (blocking_factor, record_size):
Don’t limit blocking factor to INT_MAX.
Prefer signed type for record_size.
Do not exceed IDX_MAX or SSIZE_MAX for record_size;
the SSIZE_MAX limit is needed so that ‘read’ and ‘write’
calls behave sensibly.

11 months agoDefault to GNU/Linux dev_t etc
Paul Eggert [Thu, 8 Aug 2024 00:05:13 +0000 (17:05 -0700)] 
Default to GNU/Linux dev_t etc

* configure.ac (dev_t, ino_t, major_t, minor_t):
Default to GNU/Linux types.  This shouldn’t affect behavior;
it’s just a cleanup.

11 months agoAvoid strtoul
Paul Eggert [Thu, 8 Aug 2024 00:03:22 +0000 (17:03 -0700)] 
Avoid strtoul

This is part of the general trend to prefer signed integer types,
to allow better runtime checking with -fsanitize=undefined etc.
* gnulib.modules: Remove strtoul.  Add xstrtoimax.
* src/checkpoint.c (checkpoint, format_checkpoint_string):
* src/system.c (sys_exec_checkpoint_script):
* src/tar.c (checkpoint_option):
Use intmax_t, not unsigned, for checkpoint numbers.
All uses changed.
* src/checkpoint.c (checkpoint_compile_action): Don’t assume
time_t == unsigned long.  Treat overflows as TYPE_MAXIMUM (time_t),
essentially infinity.
* src/tar.c (tar_sparse_major, tar_sparse_minor):
* src/tar.h (struct tar_stat_info):
Use intmax_t, not unsigned, for sparse major and minor.
All uses changed.
* src/tar.c (parse_opt):
Don’t mishandle multiple specifications of sparse major and minor.
* src/transform.c (struct transform):
Use idx_t, not unsigned, for match_number.  All uses changed.
(parse_transform_expr): Don’t mishandle large match numbers
by wrapping them around.

11 months agoAvoid snprintf
Paul Eggert [Sun, 4 Aug 2024 08:37:07 +0000 (01:37 -0700)] 
Avoid snprintf

* gnulib.modules: Remove snprintf.
* lib/wordsplit.c (wordsplit_pathexpand):
Do not arbitrarily truncate diagnostic.
(wordsplit_c_quote_copy): Rewrite to avoid the need to
invoke snprintf on a temporary buffer.

11 months agoAvoid wordsplit quadratic behavior
Paul Eggert [Sun, 4 Aug 2024 08:04:56 +0000 (01:04 -0700)] 
Avoid wordsplit quadratic behavior

* lib/wordsplit.c (wsplt_assign_var):
Avoid unlikely overflow when adding wsp->ws_envidx + n.
Avoid quadratic behavior when growing ws_envbuf.

11 months agoPrefer ialloc for wordsplit
Paul Eggert [Sun, 4 Aug 2024 07:24:15 +0000 (00:24 -0700)] 
Prefer ialloc for wordsplit

* lib/wordsplit.c (alloc_space, wsplt_assign_var, expvar)
(wordsplit_tildexpand, wordsplit_pathexpand)
(wordsplit_get_words): Use ialloc API on idx_t args.

11 months agoOmit wordsplit API that tar doesn’t need
Paul Eggert [Sun, 4 Aug 2024 04:05:42 +0000 (21:05 -0700)] 
Omit wordsplit API that tar doesn’t need

* lib/wordsplit.c: Include <attribute.h> here, not in wordsplit.h.
(WRDSO_ESC_SET, WRDSO_ESC_TEST): Move here from wordsplit.h.
(WORDSPLIT_EXTRAS_extern): New macro.  Used by functions
that tar doesn’t need to be exposed.
(wordsplit_append, wordsplit_c_quoted_length, wsplt_quote_char)
(wordsplit_c_unquote_char, wordsplit_c_quote_char)
(wordsplit_c_quote_copy, wordsplit_get_words, wordsplit_perror):
Omit unless _WORDSPLIT_EXTRAS.
(WORDSPLIT_ENV_INIT): Move here from wordsplit.h, and
make it a constant rather than a macro.
(wordsplit_strerror): Arg is now pointer to const.
* lib/wordsplit.h: Do not include attribute.h, so that library
users need not worry about attribute.h.
(wordsplit_t): Declare only if _WORDSPLIT_EXTRAS.  Similarly for
functions that are not exported to tar.

11 months agowordsplit_get_words need not fail
Paul Eggert [Sat, 3 Aug 2024 22:45:53 +0000 (15:45 -0700)] 
wordsplit_get_words need not fail

* lib/wordsplit.c (wordsplit_get_words):
Do not fail merely because realloc fails.
Return void, since failure is no longer possible.

11 months agoMore wordsplit int cleanup
Paul Eggert [Sat, 3 Aug 2024 21:53:39 +0000 (14:53 -0700)] 
More wordsplit int cleanup

* lib/wordsplit.c: Include limits.h.
(_wsplt_subsplit, wordsplit_add_segm, wsnode_quoteremoval)
(wsnode_coalesce, wsnode_tail_coalesce, find_closing_paren)
(expvar, begin_var_p, node_expand, begin_cmd_p, expcmd)
(scan_qstring, scan_word, wordsplit_c_quoted_length)
(wordsplit_string_unquote_copy, wordsplit_c_quote_copy)
(exptab_matches, wordsplit_process_list):
Prefer bool to int.
(wordsplit_init, alloc_space, coalesce_segment)
(wsnode_quoteremoval, wordsplit_finish, wordsplit_append):
Use WRDSE_OK instead of 0 when the context is that of WRDSE_*.
(wsnode_flagstr, coalesce_segment, wsnode_quoteremoval)
(wordsplit_finish, node_split_prefix, wsplt_assign_var, expvar)
(expcmd, wordsplit_tildexpand, wordsplit_pathexpand)
(wsplt_unquote_char, wsplt_quote_char)
(wordsplit_string_unquote_copy):
Prefer '\0' to 0 when it is a char.
(wsnode_insert): Omit last arg, which was always 0.
All callers changed.
(wordsplit_add_segm, node_split_prefix):
Use unsigned, not int, for flag, for consistency.
(wordsplit_finish, begin_var_p, begin_cmd_p, skip_sed_expr)
(xtonum, wsplt_unquote_char, wsplt_quote_char)
(wordsplit_c_unquote_char, wordsplit_c_quote_char)
(wordsplit_c_quote_copy):
Prefer char to int for chars.
(xtonum): Don’t treat "\400" as if it were "\000".

11 months agoDiagnose argp overflow
Paul Eggert [Sat, 3 Aug 2024 18:55:39 +0000 (11:55 -0700)] 
Diagnose argp overflow

* src/names.c (handle_option):
* src/tar.c (parse_default_options):
Report an error if wordsplitting yields more than INT_MAX words,
rather than misbehaving.  argp_parse can’t handle more than
INT_MAX, unfortunately.

11 months agoFix unlikely buffer overrun when checkpointing
Paul Eggert [Sat, 3 Aug 2024 18:52:17 +0000 (11:52 -0700)] 
Fix unlikely buffer overrun when checkpointing

* src/checkpoint.c (format_checkpoint_string):
Don’t overrun buffer when word splitting.

11 months agoPrefer idx_t to size_t in wordsplit
Paul Eggert [Sat, 3 Aug 2024 18:47:13 +0000 (11:47 -0700)] 
Prefer idx_t to size_t in wordsplit

* gnulib.modules: Add ialloc.
* lib/wordsplit.c: Include ialloc.h.
(PRINTMAX): New constant.
(printflen, printfdots): New functions.
(wordsplit_dump_nodes, expvar, wordsplit_process_list): Use them.
(_wsplt_subsplit, wordsplit_string_unquote_copy):
Don’t limit lengths to INT_MAX.
(wordsplit_run): Remove.  All callers changed to use wordsplit_len.
(wordsplit_perror): Don’t limit lengths to ULONG_MAX.
* lib/wordsplit.c (wordsplit_init, alloc_space, struct wordsplit_node)
(wsnode_len, wordsplit_add_segm, coalesce_segment, wsnode_quoteremoval)
(wordsplit_finish, wordsplit_append, node_split_prefix)
(find_closing_paren, wordsplit_find_env, wsplt_assign_var)
(expvar, node_expand, expcmd, wordsplit_trimws)
(wordsplit_tildexpand, isglob, wordsplit_pathexpand)
(skip_sed_expr, skip_delim_internal, skip_delim)
(skip_delim_real, scan_qstring, scan_word)
(wordsplit_c_quoted_length, wordsplit_process_list)
(wordsplit_len, wordsplit_free_words, wordsplit_get_words):
* lib/wordsplit.h (struct wordsplit):
Prefer idx_t to size_t for indexes.
* lib/wordsplit.h: Include idx.h.

11 months agoSupport >INT_MAX -C dirs
Paul Eggert [Sat, 3 Aug 2024 16:35:46 +0000 (09:35 -0700)] 
Support >INT_MAX -C dirs

* src/extract.c (struct delayed_set_stat, struct delayed_link):
* src/misc.c (normalize_filename, wd_count, chdir_count)
(chdir_arg, tar_getcdpath):
* src/names.c (name_gather, addname, add_hierarchy_to_namelist):
* src/unlink.c (struct deferred_unlink, flush_deferred_unlinks):
Use idx_t, not int, for directory indexes, so as to not
limit their number to INT_MAX; this is theoretically possible
if -T is used.
* src/names.c (name_next_elt, name_next):
Use bool for boolean.

11 months agomaint: fix some encodings and email addresses
Paul Eggert [Sat, 3 Aug 2024 07:18:51 +0000 (00:18 -0700)] 
maint: fix some encodings and email addresses

11 months agoParse level options more reliably
Paul Eggert [Sat, 3 Aug 2024 06:33:50 +0000 (23:33 -0700)] 
Parse level options more reliably

* src/tar.c (parse_opt): Don’t mishandle out-of-range LEVEL_OPTION.

11 months agoMinor utf8.c improvements
Paul Eggert [Sat, 3 Aug 2024 06:32:42 +0000 (23:32 -0700)] 
Minor utf8.c improvements

* src/utf8.c: Minor rephrases for -1.

11 months agoSimplify ST_DEV_MSB
Paul Eggert [Sat, 3 Aug 2024 06:30:42 +0000 (23:30 -0700)] 
Simplify ST_DEV_MSB

* src/incremen.c (ST_DEV_MSB):
Use TYPE_WIDTH rather than computing it by hand.

11 months agoUse ckd_mul, ckd_add in to_octal, to_base256
Paul Eggert [Sat, 3 Aug 2024 06:29:56 +0000 (23:29 -0700)] 
Use ckd_mul, ckd_add in to_octal, to_base256

* src/create.c (to_octal, to_base256): Simplify.

11 months agoUse ckd_mul, ckd_add in from_header
Paul Eggert [Sat, 3 Aug 2024 05:13:20 +0000 (22:13 -0700)] 
Use ckd_mul, ckd_add in from_header

* src/common.h (LG_64): Remove; no longer used.
* src/list.c (from_header):
Use ckd_mul, ckd_add rather than doing it by hand.

11 months agoPrefer < 0 to == -1 where either will do
Paul Eggert [Sat, 3 Aug 2024 05:11:13 +0000 (22:11 -0700)] 
Prefer < 0 to == -1 where either will do

Also, fix an unlikely read overflow in sys_exec_setmtime_script.
* src/buffer.c (open_compressed_archive):
* src/compare.c (verify_volume):
* src/exclist.c (info_attach_exclist):
* src/misc.c (xfork):
* src/sparse.c (sparse_scan_file_seek):
* src/system.c (sys_wait_for_child, sys_spawn_shell)
(wait_for_grandchild, sys_wait_command, sys_exec_info_script)
(sys_exec_checkpoint_script, sys_exec_setmtime_script):
* src/transform.c (_single_transform_name_to_obstack):
* src/xattrs.c (xattrs__acls_set, xattrs_acls_get)
(xattrs_xattrs_get, xattrs__fd_set, xattrs_selinux_get)
(xattrs_selinux_set):
* tests/checkseekhole.c (check_seek_hole, main):
Simplify failure tests by just looking at return value sign.
* src/system.c (sys_exec_setmtime_script):
Don’t assume ‘read’ result fits in int.
(sys_exec_setmtime_script): Don’t reject 1 second before Epoch.

11 months agoxsparse dry runs should not create output
Paul Eggert [Sat, 3 Aug 2024 04:58:53 +0000 (21:58 -0700)] 
xsparse dry runs should not create output

* scripts/xsparse.c (expand_sparse, main): Check for syscall
failure.  Do not create output file if a dry run.

11 months agoBetter xsparse outname guessing
Paul Eggert [Fri, 2 Aug 2024 18:23:23 +0000 (11:23 -0700)] 
Better xsparse outname guessing

* scripts/xsparse.c (guess_outname): Use simpler algorithm,
that doesn’t mishandle outnames like ‘/foo’.

11 months agoUse xalignalloc
Paul Eggert [Fri, 2 Aug 2024 16:32:11 +0000 (09:32 -0700)] 
Use xalignalloc

It ports around issues that our handwritten code does not.
* gnulib.modules: Add xalignalloc.
* src/misc.c (ptr_align, page_aligned_alloc): Remove.
All page_aligned_alloc callers changed to use xalignalloc.

11 months agoMake stripped_prefix_len signed
Paul Eggert [Fri, 2 Aug 2024 16:07:06 +0000 (09:07 -0700)] 
Make stripped_prefix_len signed

This is part of the general guideline that signed integer types
are safer.
* src/names.c (stripped_prefix_len): Return ptrdiff_t,
not size_t.  All callers changed.

11 months agofrom_header minor width cleanup
Paul Eggert [Fri, 2 Aug 2024 07:29:07 +0000 (00:29 -0700)] 
from_header minor width cleanup

* src/list.c (from_header): Use UINTMAX_WIDTH rather than
computing it by hand.

11 months agoDon’t assume mode_t fits in unsigned long
Paul Eggert [Fri, 2 Aug 2024 07:27:40 +0000 (00:27 -0700)] 
Don’t assume mode_t fits in unsigned long

* src/system.c (oct_to_env): Don’t assume mode_t fits in unsigned
long.  Do not output excess leading 1 bits.  When the mode is
zero, generate "0" rather than "00".  Use sprintf instead of
snprintf, since the output won’t be truncated; in general we don’t
use snprintf unless we want output to be truncated and truncation
is typically not GNU style.

11 months agoPrefer C99 formats like %jd to doing it by hand
Paul Eggert [Fri, 2 Aug 2024 02:31:50 +0000 (19:31 -0700)] 
Prefer C99 formats like %jd to doing it by hand

It’s now safe to assume support for C99 formats like %jd, so remove
some of the longwinded formatting code put in only to be portable to
pre-C99 platforms.
* gnulib.modules: Add intprops.
* src/buffer.c (format_total_stats, try_new_volume)
(write_volume_label):
* src/checkpoint.c (format_checkpoint_string):
* src/compare.c (verify_volume):
* src/create.c (to_chars_subst, dump_regular_file):
* src/incremen.c (read_num):
* src/list.c (read_and, from_header, simple_print_header)
(print_for_mkdir):
* src/sparse.c (sparse_dump_region):
* src/system.c (dec_to_env, sys_exec_info_script)
(sys_exec_checkpoint_script):
* src/xheader.c (out_of_range_header):
Prefer C99 formats like %jd and %ju to STRINGIFY_BIGINT.
* src/common.h: Sort includes.
Include intprops.h, verify.h.  All other includes of verify.h
removed.
(intmax, uintmax): New functions and macros.
(STRINGIFY_BIGINT): Remove; no longer used.
(TIMESPEC_STRSIZE_BOUND): Make it 1 byte bigger, for negatives.
* src/create.c (MAX_VAL_WITH_DIGITS, to_base256):
Use *_WIDTH macros rather than assuming no padding bits.
Prefer UINTMAX_MAX to (uintmax_t) -1.
* src/list.c (tartime): Use strftime result rather
than running strlen later.
* src/misc.c (timetostr): New function.  Prefer it when
printing time_t values.

11 months agoFix unlikely problems with time overflow
Paul Eggert [Thu, 1 Aug 2024 17:02:06 +0000 (10:02 -0700)] 
Fix unlikely problems with time overflow

Also, fix some rounding errors while we’re in the neighborhood.
* src/buffer.c (duration_ns, compute_duration_ns): Rename from
‘duration’ and ‘compute_duration’, and count ns rather than s, to
lessen rounding error.  All uses changed.
(compute_duration_ns): Work even if the clock moves backward
and time_t is unsigned.
(print_stats): Don’t worry about null or empty TEXT, as that
cannot happen.  Compare double to UINTMAX_MAX + 1.0, not
to UINTMAX_MAX, so that the comparison is exact.
Handle the unlikely case that numbytes >= UINTMAX_MAX.
* src/tar.c (parse_opt): Treat -L hugenumber as effectively
infinity rather than erroring out.
Prefer ckd_add to checking overflow by hand.

11 months agomaint: omit space between "*" and "p"
Paul Eggert [Thu, 1 Aug 2024 14:17:32 +0000 (07:17 -0700)] 
maint: omit space between "*" and "p"

11 months agoptrdiff_t, not int
Paul Eggert [Thu, 1 Aug 2024 14:16:49 +0000 (07:16 -0700)] 
ptrdiff_t, not int

* src/delete.c (delete_archive_members): Use ptrdiff_t, not int,
to count memory blocks.
(write_recent_bytes): Simplify remainder calculation.

11 months agoptrdiff_t, not ssize_t
Paul Eggert [Thu, 1 Aug 2024 14:15:01 +0000 (07:15 -0700)] 
ptrdiff_t, not ssize_t

* src/buffer.c (bufmap_reset, _flush_write):
Use ptrdiff_t, not ssize_t, to record pointer differences.
POSIX allows systems where size_t is 64 bits but ssize_t is only 32;
Ultrix used to do that, though no current systems do.

11 months agoPrefer stdckdint.h to intprops.h
Paul Eggert [Wed, 31 Jul 2024 00:59:04 +0000 (17:59 -0700)] 
Prefer stdckdint.h to intprops.h

Problem reported by Collin Funk in:
https://lists.gnu.org/r/bug-tar/2024-07/msg00000.html
though this patch is more general than Collin’s suggestion.
* src/compare.c (diff_multivol):
* src/delete.c (move_archive):
* src/sparse.c (oldgnu_add_sparse, pax_decode_header):
* src/system.c (mtioseek):
Prefer ckd_add and ckd_mul to the intprops.h equivalents,
since stdckdint.h is now standard.