Commit graph

14975 commits

Author SHA1 Message Date
Stefan Eßer
98d3422e5e usr.bin/stat: honour locale for "-t %+"
The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

(cherry picked from commit 20f8331aca)
2022-03-04 20:43:01 +01:00
Stefan Eßer
6f9036a651 netstat: Fix typo
Correct spelling of "received packers" to "received packets".

(cherry picked from commit c5b8d7b7c1)
2022-03-04 20:41:55 +01:00
Stefan Eßer
c82c2fb1ae usr.bin/calendar: do not treat // in text as comment
The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs	in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.

Change parsing of "//" to only start a comment at the begin of a line
or when	preceeded by a white-space character.

(cherry picked from commit 35b8fd0b69)
2022-03-04 20:41:02 +01:00
Jamie Gritton
1e40fc6fa9 MFC posixshm: Add a -j option to posixshmcontrol ls, to specify a jail
PR:		257556
Reported by:	grembo@

(cherry picked from commit be7cf3f4b8)
2022-03-02 15:10:33 -08:00
Eric van Gyzen
9bee45e915 gzip: fix error handling in unxz
The result of fstat() was not checked.  Furthermore, there was a
redundant check of st.st_size.  Fix both.

Reported by:    Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 58135fbd8b)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
5be8c23a34 elfdump: handle small files more gracefully
elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes.  With the -E flag, elfdump should
simply exit non-zero.  For tiny files, the code would reference off
the end of the mapped region.

Ensure the file is large enough to contain an ELF header before mapping it.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 86e5e10daf)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
22561b00ab Integrate contrib/file/tests with kyua/atf
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by:	delphij (earlier version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34303

(cherry picked from commit 1581ec9a45)
2022-03-02 15:56:31 -06:00
Eugene Grosbein
39d81d46aa fetch(1): merge several improvements for handling of soft failures
Let "fetch -a" resume truncated transfer automatically to perform
another attempt if it obtained some new data in previous one
making progress.

Do not consider HTTP 5XX errors as soft failures.
Also, authorization errors should not be considered as soft failures.

(cherry picked from commit e3bad5f7aa)
(cherry picked from commit a4efbe0d6d)
(cherry picked from commit bf599c03f0)
(cherry picked from commit 08a2504a20)
(cherry picked from commit 85f15576b4)
2022-02-26 14:19:19 +07:00
Glen Barber
9134a39850 13.1: update stable/13 to -PRERELEASE to start the release cycle
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-02-23 23:21:49 -05:00
Martin Matuska
bfa5e5858f libarchive: import changes from upstream
Libarchive 3.6.0

New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support

Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
   fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
   extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries

Relnotes:	yes

(cherry picked from commit 833a452e9f)
2022-02-23 08:56:34 +01:00
Michael Tuexen
8147d64bf1 sockstat: fix usage string
Sponsored by:	Netflix, Inc.

(cherry picked from commit 6ad26abca5)
2022-02-23 01:11:25 +01:00
Michael Tuexen
dee236b2c3 sockstat: add -i to display inp_gencnt
The inp_gencnt will be used to identify a TCP endpoint by an upcoming
command line tool to set TCP socket options.

Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34137

(cherry picked from commit 5f64777a4f)
2022-02-23 01:10:32 +01:00
Ed Maste
5d03965e41 elfctl: whitespace cleanup
Reported by:	jrm (in review D34283)

(cherry picked from commit 828e50092a)
2022-02-22 14:54:41 -05:00
Ed Maste
417be38b9f vtfontcvt: update FreeBSD Foundation copyrights
Remove "All Rights Reserved"

(cherry picked from commit 4e1e3ff571)
2022-02-22 14:53:41 -05:00
Ed Maste
cac751fb5f elfctl: fix operations with multiple features on multiple files
Previously an invocation like

  elfctl -e +feature1,feature2 file1 file2

would set both feature flags in file 1 but only feature1 in file2 (due
to the string being modified by strsep()).

Reported by:	jrm
Tested by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34283

(cherry picked from commit 82b611ed18)
2022-02-17 19:31:57 -05:00
Ed Maste
85d997620e elfctl: error if -e is specified multiple times
Reported by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f0cf9b602d)
2022-02-17 19:31:46 -05:00
Ed Maste
f6c74bacf5 elfctl: fix -e invalid operation error handling
Validate the operation prior to parsing the feature string, so that e.g.
-e 0x1 reports invalid operation '0' rather than invalid feature 'x11'.
Also make it an error rather than a warning, so that it is not repeated
if multiple files are specified.

(Previously an invalid operation resulted in a segfault.)

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b8185579f4)
2022-02-17 19:31:26 -05:00
Simon J. Gerraty
bd8bde1385 Merge bmake-20220208
* unit-tests/Makefile: disable opt-debug-x-trace on Linux if there
        is any chance we have dash as .SHELL

        * meta.c: use a variable to hold command line to be filtered
        to avoid any side effects from content of command line.

Merge commit '535c59a6a9214436f5d6643775d29808e4b3408d'

(cherry picked from commit a6f0e10b24)
2022-02-15 21:37:08 -08:00
Simon J. Gerraty
22ade366be Update to bmake-20220204
(cherry picked from commit 6598559fdf)
2022-02-15 21:37:08 -08:00
Simon J. Gerraty
7f1879d674 After-import bmake-20211212
(cherry picked from commit 1c04cf7d54)
2022-02-15 21:37:07 -08:00
Simon J. Gerraty
9956ced97e Update to bmake-20210621
MFC after:	1 week

(cherry picked from commit 68c4481aac)
2022-02-15 21:36:27 -08:00
Gordon Bergling
5e730b3fde ipsec(4): Fix a few typos in error messages
- s/receieve/receive/

(cherry picked from commit ecc467ebad)
2022-02-13 08:54:53 +01:00
Ed Maste
c4408d2bef elfctl: update man page example for 'no' prefix
Reported by:	Mark Millard on freebsd-current@
Fixes:		c763f99d11 ("elfctl: prefix disable flags with "no"")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dbc7364b18)
2022-02-09 12:28:41 -05:00
Mark Johnston
4cd49eda1f ar: Avoid overwriting the stdout file stream pointer
This doesn't work with musl, which defines stdout as FILE * const.
Instead, explicitly pass the desired output stream to ar_read_archive().

No functional change intended.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34064

(cherry picked from commit 41e6398f9b)
2022-02-09 10:25:28 -05:00
Ed Maste
d8ffb45119 ar: diff reduction against ELF Tool Chain
- Drop exit status from bsdar_errc.  ELF Tool Chain always returns
  EXIT_FAILURE in bsdar_errc.

- Remove ar_mode_* wrappers and call ar_read_archive / ar_write_archive
  directly.

Obtained from:	ELF Tool Chain
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31496

(cherry picked from commit d20e9e02db)
(cherry picked from commit c5bf58add0)
(cherry picked from commit 086f090877)
(cherry picked from commit 57aaefdcec)
(cherry picked from commit 866c807472)
2022-02-09 10:25:28 -05:00
Ed Maste
4a0d7fd173 vtfontcvt: minor style(9) fixes from clang-format
Found during clang-format experiments (in D26340).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30237

(cherry picked from commit a0d701f614)
2022-02-08 15:51:34 -05:00
Mark Johnston
1a233fd317 sort: Fix message catalogue usage
- Check that catopen() succeeded before calling catclose().  musl will
  crash in the latter if the catalogue descriptor is -1.
- Keep the message catalogue open for most of sort(1)'s actual
  operation.
- Don't use catgets(3) to print error messages if catopen(3) had failed.

Reviewed by:	arichardson, emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8d8b9b560a)
2022-02-04 09:58:13 -05:00
Mark Johnston
40d6b2a362 exec: Remove the stack gap implementation
ASLR stack randomization will reappear in a forthcoming commit.  Rather
than inserting a random gap into the stack mapping, the entire stack
mapping itself will be randomized in the same way that other mappings
are when ASLR is enabled.

No functional change intended, as the stack gap implementation is
currently disabled by default.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 758d98debe)
2022-01-31 09:48:57 -05:00
Jessica Clarke
8599e69d56 etdump: Fix the file name included in the could not open error message
If only one file is passed, this reads the terminating NULL and so
prints (null). If multiple files are passed then this always prints the
second file, which may or may not exist (and will be particularly
confusing if it does exist since the output will include the dump of the
second file).

MFC after:	1 week

(cherry picked from commit 340cebe990)
2022-01-25 00:00:05 +00:00
Konstantin Belousov
29887e602b truss(1): detach more carefully
(cherry picked from commit 12f747e6ff)
2022-01-19 02:46:08 +02:00
Konstantin Belousov
7545bb2ba7 truss: remove write-only variable
(cherry picked from commit ba33c28848)
2022-01-19 02:46:08 +02:00
Kirk McKusick
18870c75bf systat -vm: Humanize output for ease of reading.
Using 8 width is too wide for large numbers like 1379991K;
1330M is easier to read.

Submitted by: ota_j.email.ne.jp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33495

(cherry picked from commit a115a4aa51)
2022-01-18 15:09:19 -08:00
Konstantin Belousov
6c12b39228 script(1): work around slow reading child
PR:	260938

(cherry picked from commit c0ba4c2ee2)
2022-01-15 14:55:32 +02:00
Stefan Eßer
379bfb2aa9 sys/bitset.h: reduce visibility of BIT_* macros
(cherry picked from commit 5e04571cf3)
2022-01-14 18:17:30 +02:00
Gleb Smirnoff
1e2a0cef6b tcptw: count how many times a tcptw was actually useful
This will allow a sysadmin to lower net.inet.tcp.msl and
see how long tcptw are actually useful.

(cherry picked from commit 71d2d5adfe)
2022-01-13 13:19:40 -08:00
Emmanuel Vadot
ac36d4f03a pkgbase: Create a FreeBSD-fetch package
It's useful for small image to fetch some data but we don't want to
install utilities nor bloat runtime.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33463

(cherry picked from commit 13ef8134ef)
2022-01-05 18:23:53 +01:00
Emmanuel Vadot
b2d245a0b0 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435

(cherry picked from commit 93c4369096)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
26c7445164 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
880b9a8af6 pkgbase: Create a FreeBSD-ftp package
ftp tools aren't that useful nowadays but some might want them.
Create a FreeBSD-ftp package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31794

(cherry picked from commit b5be5c35db)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
f5ab36c2e1 pkgbase: Create a FreeBSD-kerberos package
This allows users to install or not kerberos related utilities
and libs.

Differential Revision:	https://reviews.freebsd.org/D31801

(cherry picked from commit a30235a4c3)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
8d7e0c5a45 pkgbase: Create a FreeBSD-rdma package
Put all the rdma related tools into this package.

Differential Revision:	 https://reviews.freebsd.org/D31799

(cherry picked from commit cab6a39d7b)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
872aa9c8a6 pkgbase: Create a FreeBSD-telnet package
both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31791
Reviewed by: emaste

(cherry picked from commit c7fd29f0f2)
2022-01-05 18:23:49 +01:00
Ed Maste
2076973231 ar: deprecate -T option
Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR:		260523 [exp-run]
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit edadbb4606)
2022-01-04 20:53:27 -05:00
Ed Maste
b498248f7a lorder: add note that it is no longer required
Use of lorder(1) is not required by contemporary linkers.

The GNU coreutils manual[1] has a good description of the use of lorder
and tsort:

    This whole procedure has been obsolete since about 1980, because
    Unix archives now contain a symbol table (traditionally built by
    ranlib, now generally built by ar itself), and the Unix linker uses
    the symbol table to effectively make multiple passes over an archive
    file.

See 0e1e341b48 for some more details.

[1] https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html

PR:		259254 [exp-run]
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 3e01ee76f2)
2022-01-02 20:17:00 -05:00
Konstantin Belousov
d00ebd9b9c Pass vdso address to userspace
(cherry picked from commit 01c77a436e)
2022-01-02 18:43:01 +02:00
Bryan Drewery
5815ac31d9 Fix 'make bmake' top-level bootstrapping.
Fixes:	ee10666327
(cherry picked from commit eb8bf6bb42)
2021-12-21 14:44:51 +01:00
Simon J. Gerraty
886e5802c4 bsd.links.mk wants full paths
The values in LINKS need to be full paths.

(cherry picked from commit 85d6747a69)
2021-12-21 14:44:49 +01:00
Simon J. Gerraty
fffeae4102 Links for bmake and bmake.1
Some folk forget that make is bmake, and want the links...

MFC after: 1 week

(cherry picked from commit ee10666327)
2021-12-21 14:44:48 +01:00
Marcin Wojtas
7572ddd167 usr.bin/elfctl: Allow for cross-endian operations.
Detect if host endian is different than target endian and swap
byte order of ELF note fields instead of failing.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: imp
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29550

(cherry picked from commit 4a27bf128b)
2021-12-12 13:59:30 -05:00
Mike Karels
c7444d9cb3 systat: clean up code assuming network classes
Similar to netstat, clean up code that uses inet_lnaof() to check for
binding to "host 0" (lowest host on network) as a "network" bind.
Such things don't happen, and current networks are seldom if ever
found in /etc/networks.

(cherry picked from commit a2e7dfca86)
2021-12-10 10:27:44 -06:00