| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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’.
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/rtapelib.c (do_command, rmt_write__): Use function
prototypes instead of old-style decls.
* paxlib/error.c (write_fatal): Remove unused and undeclared
function.
* paxlib/paxlib.h (stat_fatal, pax_exit): Add noreturn attribute.
(write_error_details): New decl.
* rmt/rmt.c (rmt_read, rmt_write, rmt_reply, rmt_error_message):
(rmt_error, xlat_kw, skip_ws, decode_open_flag, close_device):
(lseek_device, read_device, write_device, iocop_device, status_device):
Declare as static, since they're not exported.
Use function prototypes (void) instead of old-style decls ().
|
|
|
|
|
|
|
| |
* lib/rmt.h (rmtcreat): Use fcntl O_ macros insead of
their hardcoded values.
* lib/rtapelib.c (rmt_read__,rmt_ioctl__): Prevent
potential overflow.
|
|
|
|
|
| |
* lib/rtapelib.c (rmt_open__): Return appropriate diagnostics if
the host name cannot be resolved.
|
|
|
|
|
|
| |
* lib/system.h: Include pwd.h and grp.h if the corresponding HAVE_
preprocessor symbols are defined.
* m4/system.m4 (AC_CHECK_HEADERS_ONCE): Add pwd.h and grp.h.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
to accommodate recent changes to gnulib and tar.
* rmt/rmt.c: Likewise.
* rmt/Makefile.am (rmt.o): Depend on configmake.h, not localedir.h.
* m4/system.m4 (PU_SUSTEM): Put AC_REQUIRE wrappers around
AC_HEADER_STDC, etc. This avoids a warning from automake,
with the latest gnulib.
|
|
|
|
|
|
|
| |
The latest gnulib lets us do this.
* m4/system.m4 (PU_SYSTEM): Don't check for inttypes.h.
Don't require gl_AC_TYPE_UINTMAX_T.
Require gl_INTTYPES_H, gl_STDINT_H.
|
| |
|
|
|
|
| |
is no longer used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
since we no longer use HAVE_SYS_TIME_H.
(AC_CHECK_DECLS): Don't check for 'time', since we assume
C89 or better.
* lib/system.h: Include <unistd.h> unconditionally, since we now
assume the unistd module.
(time): Remove decl; not needed, since we assume C89 or better.
Don't bother checking for HAVE_SYS_TIME_H when deciding whether
to include <sys/time.h>, since TIME_WITH_SYS_TIME implies sys/time.h
exists.
* m4/system.m4 (PU_SYSTEM): Don't check for unistd.h or sys/time.h,
or for time or valloc.
|
|
|
|
|
|
|
|
|
|
| |
* lib/system.h: Move the MTIO* stuff into....
* lib/system-ioctl.h: New file. That way, the symbols defined
by these includes won't collide with the symbols defined by
<sys/filio.h> on Solaris when compiling misc.c.
* lib/rtapelib.c: Include system-ioctl.h.
* paxlib/rtape.c: Likewise.
* rmt/rmt.c: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
is always defined now.
* paxlib/rtape.c (encode_oflag): Likewise.
* lib/system.h (O_DIRCTORY, O_NOATIME, O_NONBLOCK): Define to 0
if not already defined.
* paxlib/error.c (rmdir_error): New function.
* paxlib/error.h (rmdir_error): New decl.
* rmt/rmt.c (decode_oflag): Use '#if O_NONBLOCK", not ifdef.
|
|
|
|
| |
headers don't.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gnulib.modules: Add inttostr, quote, quotearg.
* lib/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
(INT_STRLEN_BOUND): Remove.
Include "intprops.h" instead.
(UINTMAX_STRSIZE_BOUND): Define in terms of INT_BUFSIZE_BOUND,
not INT_STRLEN_BOUND.
[HAVE_UTIME_H]: Don't include utime.h.
* paxlib/DISTFILES: Remove convert.c.
* paxlib/convert.c: Remove.
* paxlib/error.c: Include quote.h, quotearg.h.
* paxlib/paxlib.h: Include inttostr.h.
(STRINGIFY_BIGINT): Define in terms of umaxtostr.
(stringify_uintmax_t_backwards): Remove decl.
* tests/genfile.c: Include <utimens.h> instead of rolling our own.
(exec_checkpoint): Use utimens instead of rolling our own.
Don't pass extra args to error.
(main): Wrap message inside _().
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|