summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* genfile: implement the --set-time optionHEADmasterSergey Poznyakoff2023-05-172-7/+87
| | | | | * doc/genfile.texi: Document changes. * tests/genfile.c: New options: --set-time and --no-dereference.
* Update copyright yearPaul Eggert2023-01-0638-42/+41
| | | | | | | UPDATE_COPYRIGHT_USE_INTERVALS=1 \ UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 \ gnulib/build-aux/update-copyright \ $(git ls-files | sed -e '/^gnulib$/d; /^COPYING$/d')
* Package PRINT_INT inside do-whilePaul Eggert2022-09-101-8/+12
| | | | | * tests/genfile.c (PRINT_INT): Put statement body inside do-while to avoid if-else issues.
* Fix seek_warn_details typoPaul Eggert2022-09-101-1/+1
| | | | | * paxlib/error.c (seek_warn_details): Change int to intmax_t to fix recently-introduced typo.
* Exploit recent Gnulib stdbool changesPaul Eggert2022-09-101-1/+0
| | | | | * lib/system.h: Do not include <stdbool.h>, as the Gnulib stdbool module now emulates C23.
* Modernize integer handlingPaul Eggert2022-09-1010-112/+92
| | | | | | | | | | | | | | | | | | | | | | | | It’s now safe to assume C99 sprintf %jd, etc. * am/system.m4 (PU_SYSTEM): Do not require gl_INTTOSTR. * gnulib.modules, paxlib.modules: Remove inttostr. Add strtoimax, strtoumax. * lib/system.h (UINTMAX_STRSIZE_BOUND): Remove. * paxlib/error.c (chown_error_details, read_error_details) (read_warn_details, read_fatal_details, seek_error_details) (seek_warn_details, write_error_details): * paxlib/rtape.c (rmt_read, rmt_write, rmt_lseek, rmt_ioctl): * rmt/rmt.c (rmt_reply): * tests/genfile.c (verify_file, print_stat): Use C99 printf formats instead of doing it by hand. * paxlib/paxlib.h, rmt/rmt.c, tests/genfile.c: Do not include inttostr.h. * paxlib/paxlib.h (STRINGIFY_BIGINT): Remove. * tests/argcv.c (xtonum): Use strtol for signed int, not strtoul. * tests/genfile.c (checkpoint, verify_file, parse_opt) (exec_checkpoint, process_checkpoint, exec_command): Prefer uintmax_t to size_t for counters unrelated to object size. (PRINT_INT): New macro. (print_stat): Prefer uintmax_t to unsigned for modes.
* .gitignore improvementsPaul Eggert2022-06-121-1/+6
| | | | | | * .gitignore: Add .bz2, .gz for "make dist". Add .diff, .patch, .orig, .rej for patches. Remove [0-9]* since .patch now covers that.
* Fixes for ‘make dist’Paul Eggert2022-06-123-5/+32
| | | | | | | | * Makefile.am (EXTRA_DIST): Add DISTFILES and their contents that aren’t covered by other makefiles. (dist-hook): There is no make-ChangeLog, so make ChangeLog. * paxlib/Makefile.am (EXTRA_DIST): * rmt/Makefile.am (EXTRA_DIST): Add DISTFILES.
* rmt: port to Solaris 10Paul Eggert2022-06-121-0/+1
| | | | | * paxlib.modules: Add getline, since Solaris 10 lacks it and rmt uses it.
* Ignore-file cleanupPaul Eggert2022-06-126-171/+1
| | | | | Remove .cvsignore files, as we don’t use CVS any more. Update one .gitignore file to bootstrap-preferred form.
* Modernize to current gettext, gnulibPaul Eggert2022-06-1214-749/+912
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore, po/.gitignore: Revamp to match current source. * README: Fix typo in file name. * am/rmt.m4 (PU_RMT): Modernize to use AC_PREPROC_IFELSE instead of AC_TRY_CPP. * am/rmt.m4 (PU_RMT): * configure.ac: Modernize to use AS_HELP_STRING instead of AC_HELP_STRING. * am/system.m4 (PU_SYSTEM): * configure.ac: Remove obsolescent AC_HEADER_STDC. Use AC_CHECK_MEMBERS([struct stat.st_blksize]) instead of AC_STRUCT_ST_BLKSIZE. * am/system.m4 (PU_SYSTEM): Use AC_CHECK_HEADERS_ONCE([sys/time.h]) instead of obsolescent AC_HEADER_TIME. * bootstrap: Sync from Gnulib. * build-aux/bootstrap: Remove. * bootstrap.conf: Simplify. Don’t make m4, $source_base. (bootstrap_post_import_hook): New function, replacing a direct write. * configure.ac: Remove calls to no-longer-needed macros AC_ISC_POSIX, AM_STDBOOL_H, AC_HEADER_STDC, AC_TYPE_SIGNAL. Modernize to use AC_COMPILE_ELSE instead of AC_TRY_COMPILE. Remove MU_DEBUG_MODE, paxutils_GNULIB (not sure what those were from). Fix quoting in warning Remove Iconv code, as the iconv module should do this now. Update Gettext version from 0.12.1 (2003) to 0.21 (2020). Use AC_CONFIG_FILES. All uses of corresponding C macros changed. * gnulib.modules, paxlib.modules: Switch from gettext to gettext-h. * paxlib.modules: Add iconv.
* * gnulib.modules: Add year2038.Paul Eggert2021-10-131-0/+1
|
* Don’t overallocate rtapelib sprintf buffersPaul Eggert2021-09-171-3/+3
| | | | | | | | | * lib/rtapelib.c (rmt_lseek__, rmt_ioctl__): Don’t promote arguments of INT_STRLEN_BOUND, as that might over-allocate the resulting buffers. This is not an efficiency problem because any overallocations are tiny. However, it is confusing (to me, at least) to have code that unnecessarily overallocates, as that makes it harder to reason about integer or buffer overflow.
* Move sys_reset_uid_gid to libraryPaul Eggert2021-02-283-18/+46
| | | | | | | | | | | This fixes a problem where ‘gcc -fanalyzer -flto’ (GCC 10) complained that sys_reset_uid_gid was defined but not used in some modules. This function belonged in a .c file anyway. * lib/rtapelib.c (sys_reset_uid_gid): * paxlib/rtape.c (sys_reset_uid_gid): Move here from system.h. The code is now duplicated, but so is most of the rest of this file anyway. * lib/system.h (sys_reset_uid_gid): Remove.
* Use unsigned long int for ioctl opsPaul Eggert2021-02-284-10/+8
| | | | | | | | | | * lib/rtapelib.c (rmt_ioctl__): * paxlib/rtape.c (rmt_ioctl): Arg is now of type unsigned long int, not int. This works better on GNU/Linux, where some ioctl values used by this code do not fit in int. FreeBSD ioctl also has unsigned long int here, and old hosts where it’s int should still work when this is unsigned long int. Problem reported by clang.
* Omit ‘inline’Paul Eggert2021-02-282-2/+1
| | | | | | | | | | | | With today’s compilers ‘inline’ is typically not needed for performance (at least the way GNU Tar uses it) and it gets in the way of portability. Some compilers ignore ‘inline’ and some inline even without ‘inline’, and when inlining is haphazard GNU Tar can link on your GNU/Linux host but not link on Solaris. Better to have it not link everywhere so these problems are caught before porting. * configure.ac: Omit AC_C_INLINE; no longer needed here. * lib/system.h (sys_reset_uid_gid): No longer inline.
* Avoid linking problem in sys_reset_uid_gidPaul Eggert2021-02-283-18/+17
| | | | | | | | * lib/system.h (sys_reset_uid_gid) [!MSDOS]: On failure, instead of invoking FATAL_ERROR set errno and return the name of the syscall that failed, so that the caller can decide what to do. This avoids some GNU Tar linking problems on compilers that do not inline this function. All callers changed.
* Sort po/.gitignorePaul Eggert2021-02-281-1/+1
|
* * paxlib.modules: Add c-ctype, since we use c-ctype.h.Paul Eggert2021-02-281-0/+1
|
* Port better to non-GCC compilersPaul Eggert2021-02-273-19/+15
| | | | | | | | | Gnulib now defines _Noreturn for us on pre-C11 compilers, so use that instead of the less-portable __attribute__ ((noreturn)). * lib/system.h (__attribute__): Remove; no longer used. * paxlib/paxlib.h: Use _Noreturn instead of __attribute__ ((noreturn)). * paxtest/paxtest.c (dump): First arg is char *, not unsigned char *, to avoid type mismatch.
* * po/.gitignore: Add Makevars, paxutils.pot, stamp-po.Paul Eggert2021-02-271-1/+3
|
* Pacify rtapelib.c for GCC 10 and fix a bug or twoPaul Eggert2021-02-273-39/+28
| | | | | | | | | | | | | | | This patch assumes C99, but that’s OK nowadays. * lib/rtapelib.c: Include verify.h. (rmt_open__): Tell GCC that remote_file must be nonnull. (rmt_read__, rmt_write__, rmt_lseek__, rmt_ioctl__): Properly size outgoing command buffers instead of guessing 64. Simplify by using C99 printf formats like %zu, as that’s a safe assumption nowadays. (rmt_ioctl__): 3rd arg is now void * not char *, to pacify gcc -Wcast-align. Fix unlikely bug with short reads: ARGUMENT was being incremented, whereas later code wanted the original ARGUMENT. * paxlib.modules: Add ‘verify’.
* maint: require Autoconf 2.64Paul Eggert2021-02-271-1/+1
| | | | * configure.ac: Gnulib now requires Autoconf 2.64 or later.
* paxtest: fix link issue and pacify GCC 10Paul Eggert2021-02-271-4/+12
| | | | | | * paxtest/paxtest.c (xalloc_die): Call exit explicitly, to pacify GCC 10. (fatal_exit): New function; otherwise paxtest doesn’t link.
* rmt: fix missing includePaul Eggert2021-02-271-1/+2
| | | | | * rmt/Makefile.am (AM_CPPFLAGS): Add $(top_srcdir)/paxlib, for system.h’s ‘#include <paxlib.h>’.
* Minor changeSergey Poznyakoff2021-02-131-1/+1
|
* Fix sys_reset_uid_gid; minor changes in genfile.cSergey Poznyakoff2021-02-132-18/+38
| | | | | | | | | * lib/system.h (ERRNO_IS_EACCES): Remove. Not used anymore. (sys_reset_uid_gid): Re-initialize supplementary groups when switching privileges. Fix ordering of setgid and setuid calls. * tests/genfile.c (EXIT_USAGE) (EXIT_UNAVAILABLE): New exit codes. Use them as appropriate.
* Improve genfile exec modeSergey Poznyakoff2018-12-282-81/+74
| | | | | | | | | | | | | | | | | | | | | This commit introduces interprocess communication between genfile and subsidiary command in exec mode. Instead of using sleep as part of the checkpoint action chain (as GNU tar did so far), genfile now inserts --checkpoint-action=wait=SIGUSR1 into the command line and sends the process the SIGUSR1 after having finished with the checkpoint. This eliminates the race condition and speeds up the tests based on exec mode. The "wait" action is introduced in GNU tar 1.30.90. * doc/genfile.texi: Document changes. * tests/genfile.c (checkpoint_granularity): New variable. (parse_opt): Optional argument to --run specifies granularity. (CHECKPOINT_TEXT): Customize for genfile. (exec_command): Take command as arguments. Insert the --checkpoint and --checkpoint-action options after the command name. Use checkpoint action wait=SIGUSR1 for synchronization. Send SIGUSR1 after processing checkpoint.
* Fix in rmtSergey Poznyakoff2018-07-311-3/+7
| | | | | | * rmt/rmt.c (VDEBUG): Take 3 arguments. Maintain a local va_list variable. (rmt_write): Add missing va_end
* Fix section number in rmt.8Sergey Poznyakoff2018-03-241-3/+3
|
* Improve genfileSergey Poznyakoff2017-05-292-14/+33
| | | | | | | * tests/genfile.c: Rename --unlink option to --delete, retaining old name as alias. Call unlink or rmdir depending on the type of the argument. * doc/genfile.texi: Document changes.
* genfile: new option --quietSergey Poznyakoff2016-03-182-6/+20
| | | | | | * tests/genfile.c: New option --quite: suppress error exit if the created file is not sparse. * doc/genfile.texi: Document --quiet.
* genfile: remove unused variablePavel Raiskup2015-12-051-1/+0
| | | | * tests/genfile.c (generate_sparse_file): Remove unused 'i'.
* genfile: improve sparse modeSergey Poznyakoff2014-11-072-20/+92
| | | | | | | | * tests/genfile.c (generate_sparse_file): Handle '-' argument (read from stdin); If content strings starts with '=', treat it as fragment size and use default pattern to fill it. * doc/genfile.texi: Document changes to genfile.
* Make.rules: New variable changelog_amend_file. Remove duplicated copyleft ↵Sergey Poznyakoff2014-06-241-24/+8
| | | | header.
* Improve PU_RMT macro.Sergey Poznyakoff2014-01-271-0/+1
| | | | * am/rmt.m4 (PU_RMT): Define conditional PU_RMT_COND.
* Add rmt(8) manpageSergey Poznyakoff2014-01-272-0/+255
| | | | | * doc/rmt.8: New file. * doc/DISTFILES: Add rmt.8
* Implement pre-error-display hook.Sergey Poznyakoff2014-01-222-4/+26
| | | | | | | * paxlib/error.c (error_hook): New global. * paxlib/paxlib.h (error_hook): New extern. (WARN, ERROR, FATAL_ERROR) (USAGE_ERROR): Call error_hook (if defined) before error().
* paxutils: support --sparse with tiny files on Netapp filersPaul Eggert2013-10-281-1/+8
| | | | | | | * lib/system.h (ST_IS_SPARSE): Port to NFS + Netapp filers, where a tiny file can have zero blocks but nonzero size. Problem reported by Andrew J. Schorr in <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00030.html>.
* Improve ChangeLog generationSergey Poznyakoff2013-09-151-1/+1
| | | | * Make.rules: Output a newline after initial commit descritption.
* doc: port to texinfo 5Paul Eggert2013-04-241-21/+23
| | | | * doc/genfile.texi (Status Mode): Put FIXME at line start.
* maint: remove lint uncovered by tar's new use of manywarningsPaul Eggert2012-12-184-20/+32
| | | | | | | | | | | | | | * lib/rmt.h, lib/rtapelib.c (rmt_command, rmt_dev_name__): Now pointer to const. * lib/rtapelib.c (rmt_open__): Check return codes from dup2, close. Don't mishandle the case when 'pipe' allocates file descriptor 0. * lib/system.h (sys_reset_uid_gid): Check return codes from setuid, setgid. * tests/genfile.c (mkhole, exec_checkpoint): Check return code from ftruncate. (mkhole): Don't call fseek twice. (exec_checkpoint): Check return code from system. (exec_command): Check return code from pipe.
* Add more gnulib modules.Mike Frysinger2012-12-011-0/+2
| | | | rmt depends on argp-version-etc and progname modules.
* Ignore *~ files.Mike Frysinger2012-12-011-0/+1
|
* Use AM_CPPFLAGS rather than INCLUDES in Makefile.am'sMike Frysinger2012-12-013-3/+3
|
* Omit and/or split out functions not needed for tar.Paul Eggert2010-11-236-26/+7
| | | | | | | | | | * paxlib/DISTFILES: Add exit-status.c. * paxlib/Makefile.am (libpax_a_SOURCES): Add exit-status.c. * paxlib/exit-status.c: New file. * paxlib/exit.c (exit_status): Move to exit-status.c. * paxlib/names.c (hash_string_insert, hash_string_lookup): Remove. * paxlib/paxlib.h: Don't include hash.h. (hash_string_insert, hash_string_lookup): Remove.
* Adjust to recent gnulib changes with parse-datetime and getopt-gnu.Paul Eggert2010-10-114-7/+7
| | | | | | | | | * doc/.gitignore: Replace getdate.texi with parse-datetime.texi. * gnulib.modules: Replace getdate with parse-datetime, and getopt with getopt-gnu. * paxlib.modules: Replace getopt with getopt-gnu. * tests/genfile.c: Include parse-datetime.h, not getdate.h. All instances of get_date replaced with parse_datetime.
* paxutils: use POSIX interface for file time-settingPaul Eggert2010-09-143-3/+3
| | | | | | | | | | | This is a minor cleanup to use the POSIX.1-2008 interface for setting file time stamps to nanosecond resolution, rather than the pre-2008 gnulib interface. On older hosts, it falls back on gnulib's implementation of the POSIX interface. * configure.ac: Don't check for utimes; it's not used. * gnulib.modules: Add utimensat. * tests/genfile.c: Don't include utimens.h. (exec_checkpoint): Use POSIX utimensat function, not utimens.
* rmt: accept file open modes in combined form.Sergey Poznyakoff2010-09-141-31/+50
| | | | | | * rmt/rmt.c (rmt_write, rmt_error_message): Flush stdout. (decode_open_flag): Accept a combined form of file mode: a decimal number followed by a symbolic representation.
* paxutils: remove lint discovered by Sun C compilerPaul Eggert2010-09-042-5/+5
| | | | | | | | * paxlib/paxlib.h (pax_exit): Remove stray semicolon that I introduced in the previous patch; sorry about that. * tests/genfile.c (print_stat): Don't assume that mode_t promotes to unsigned int when calling a varargs function; that assumption is not portable.