Commit Graph

447 Commits

Author SHA1 Message Date
lukem 2756562594 pax: fix -Wformat for host tool 2023-07-20 20:10:59 +00:00
lukem 21fbd5bbde pax: need <strings.h> for ffs()
Fixes warning as host tool on NetBSD 9.99
2023-07-20 20:09:49 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem d2813c5205 pax: don't overwrite destination if -r -w copy fails
Add more error handling to pax -r -w so that any failure
during the copy to the temporary file (including a failed flush)
prevents any existing destination file from being replaced
with the partial (including possibly empty) temporary file.
The partial temporary file is removed.  pax still exists non-zero.

Thanks to Michael van Elst (mlelstv@) for the analysis
of the problem in the PR.

Should fix PR misc/33753.
2023-05-28 21:42:40 +00:00
lukem 81f726b0e0 pax: exit 0 if stdin filelist is used and empty
If copying a list of files from stdin, exit zero instead of non-zero
if there are no files supplied.

AFAICT, POSIX doesn't require a non-zero an error in this situation,
since there are no files to not match.

Fix from PR bin/41736 by Lloyd Parkes.
2023-05-28 17:01:46 +00:00
andvar 86c307248f fix various typos, mainly in comments. 2022-05-28 10:36:21 +00:00
msaitoh 344f0d1e04 s/exisit/exist/ in comment. 2021-12-05 02:52:17 +00:00
gutteridge 45137c4698 pax.1: minor grammar fixes 2021-11-06 01:19:19 +00:00
joerg d79fbfb9e8 Move definition of chdname and do_chroot to options.c 2020-04-03 16:13:32 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
uwe 9028c79eae Install manual pages for tar and cpio only if ${MKBSDTAR} == "no"
PR bin/54468
2019-08-15 21:05:16 +00:00
cheusov f8f9f44113 Fix compilation failure with gcc-8.
Equal pointers to 'struct sigaction' should not be passed to sigaction(2).
  So, we pass NULL as an "old sigaction" structure.
2019-04-24 17:27:08 +00:00
gutteridge ee05db8218 pax: fix typos in comments in file_subs.c & tar.c
Stamp out "greengrocers' apostrophes" in various places (arguably there
are still more present, but style guides vary on that, and my energies
spent corralling wayward punctuation marks could be spent elsewhere).
2019-03-20 03:13:39 +00:00
gutteridge 01205dd53a pax: minor adjustments to comments in pat_rep.c
Amend several comments to match present reality (the functionality was
added back in 2007).
2019-03-20 02:50:50 +00:00
wiz c9960b6dc5 Whitespace nits. 2019-03-19 10:14:46 +00:00
gutteridge b96bf3b04c pax.1 & tar.1: add a minor clarification about "-s"
As a somewhat pedantic clarification, "-s" does not accept backslashes
as delimiters. (While here, also make the macro use of an expression
shared between pax.1 and tar.1 consistent.)
2019-03-19 00:36:14 +00:00
gutteridge 76144f4ebd pax.1: document the "s" flag of the "s" option
Note the "s" option has an "s" flag that "prevents substitutions from
being performed on symbolic link destinations". Carry over r. 1.25 from
christos@ and part of r. 1.26 from wiz@ from tar.1, since this
functionality is available in pax as well as tar.
2019-03-19 00:12:08 +00:00
mrg f0885992ce - bump buffer sizes to avoid potential truncation issues 2019-02-04 04:36:41 +00:00
christos a4c163faee Add base-256 decoding support (Micha Gorny) 2018-11-30 00:53:11 +00:00
christos 448c6863b6 PR/53362: Thomas Barabosch: Use strlcpy() to prevent theoretical buffer
overflow.
2018-06-13 15:14:40 +00:00
msaitoh f96d27e840 s/copy copy/copy/ in comment. 2018-03-19 03:11:39 +00:00
joerg 481188eabd Include time.h for time(2). Sort. 2017-10-02 21:55:35 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
sevan 324ed4887a Document the version pax first appeared.
Bump date.
2016-08-12 01:52:22 +00:00
dholland 07c23da28f Don't use the length return from snprintf to write out the result
buffer. If snprintf truncated the output, the length returned will be
greater and we'll write trash. Just call strlen instead. (And since
what we're doing is writing progress messages to the user, checking
carefully for truncation isn't really worthwhile either.)

Spotted when attending to PR 50998 from David Binderman; the issue
there (computation of an unused value) popped up because one of the
prints was already calling strlen.
2016-05-31 03:32:36 +00:00
dholland c1c801b64b Remove undefined behavior in buf(); use buf() as intended in intarg().
While here also add includes to fix the build. Retires PR 50999 from
David Binderman.
2016-05-30 17:34:35 +00:00
wiz c78bed405e Remove trailing whitespace. 2015-12-19 18:48:41 +00:00
wiz 2c25669eb0 Use An in AUTHORS section. 2015-12-19 18:48:33 +00:00
christos 015658bfe0 Add the timestamp option to the pax front end. 2015-12-19 18:45:52 +00:00
christos 9158fb657d PR/50119: Thomas Klausner: Add --timestamp option to tar. 2015-12-19 18:28:54 +00:00
wiz 349f15a5e8 Use An in AUTHORS section. 2015-11-04 09:24:14 +00:00
pgoyette 4a0bba4840 By my count, [[[[[cc]yy]mm]dd]hh]mm[.ss] has seven fields, not six! 2015-11-03 03:01:35 +00:00
christos 7da746ab02 remove \n from error messages 2015-06-16 22:31:08 +00:00
wiz 5fe5275d9f Use An in AUTHORS section. 2015-04-11 16:22:07 +00:00
christos 23c362a5b1 Add -J/--xz to specifically decompress xz compressed files. We don't really
need this because -z autodetects the compression format; this is for syntax
compatibility with other tar implementations. From Joachim Henke
2015-04-11 15:41:33 +00:00
sevan 7c1a019ea3 From OpenBSD r1.49
Fix comment grammar
2015-03-09 23:38:08 +00:00
joerg 694cb36aee Fix RCS ID. 2014-08-08 14:48:55 +00:00
wiz 8df34715d2 Stop hissing. 2013-11-14 07:45:05 +00:00
christos e028f49d87 add --gnu for pax. 2013-11-14 04:00:48 +00:00
christos 3dd8ce9f5e Fixed unused warnings. 2013-10-18 19:53:34 +00:00
christos e164b1463b PR/48095: NAKAJIMA Yoshihiro: remove casts from time_t to long 2013-07-29 17:46:36 +00:00
christos 54f7a5dbf7 Recognize extended attribute headers and warn about them since we are not
currently handling them.
2013-01-24 17:43:44 +00:00
christos 4f5a673dad deal properly with empty lines in spec file 2012-09-27 00:44:59 +00:00
christos 6d8547fddc add missing include files 2012-08-09 11:05:59 +00:00
christos d653d57c19 PR/46786: Simon Burge: After conversion to 64 bit time_t, tar/pax/cpio
erroneously think that negative time_t's never fit in 32 bits. Rework
conversion code to always use uintmax_t, and detect negative values.
XXX[1]: Perhaps we should do the same (use a signed conversion) for all
fields not just for time_t
XXX[2]: pullup for 6
2012-08-09 08:09:21 +00:00
wiz 3957bea1ef Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
matt da4f7877a7 Use C89 function definitions 2012-03-20 18:42:28 +00:00
christos ce978720e5 Accept -X - 2011-11-03 21:59:45 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
joerg 074c0c6e91 static + __dead 2011-08-29 14:47:47 +00:00