Commit Graph

15141 Commits

Author SHA1 Message Date
Eric van Gyzen
1581ec9a45 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
2022-02-16 13:02:45 -06:00
Ed Maste
828e50092a elfctl: whitespace cleanup
Reported by:	jrm (in review D34283)
2022-02-15 08:46:14 -05:00
Ed Maste
82b611ed18 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
2022-02-15 08:42:17 -05:00
Ed Maste
b8185579f4 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
2022-02-14 22:35:03 -05:00
Ed Maste
f0cf9b602d elfctl: error if -e is specified multiple times
Reported by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-02-14 22:08:47 -05:00
Wolfram Schneider
047eec4966 improve c style
- BSD KNF: return is a native statement and we use
  a space before the parenthesis
- remove superfluous empty lines

Reported by:    jrtc27
2022-02-14 19:30:09 +00:00
Wolfram Schneider
a9a43945d3 grammar
Reported by:	jrtc27
2022-02-14 18:16:43 +00:00
Wolfram Schneider
93885bb041 Better help message if locate database does not exists
PR:		211501
Reported by:	Oliver Peter
Reviewed by:	Pau Amma
Differential Revision:	https://reviews.freebsd.org/D34243
2022-02-13 17:00:22 +00:00
Wolfram Schneider
98839c40c7 better unique file names
Our mktemp(1) implementation uses 8-X for a temp file by default.
That's ok, but we should increase the value from 8 to 10 as
many other OS already did.

PR:		261438
2022-02-12 11:35:51 +00:00
Kyle Evans
4bcc7a5f6b lsvfs: one last style nit missed in 946585179d
Space after `for`.

Sponsored by:	Klara, Inc.
2022-02-10 16:14:17 -06:00
Kyle Evans
946585179d lsvfs: restyle, no functional change
Namely:
- main was using two-space indentation
- re-sort local variables
- explicit braces for loop scope
- make flag bit comparison explicit

The first line of this commit message is unfortunately a lie, as it
introduces a minor functional change on non-FreeBSD systems.  Namely,
the first branch is now explicitly compared against `0` and the choice
was made to compare it as greater than 0 to avoid issues on other
systems where `argc != 0` on entry isn't guaranteed (negative when
checked there).

Sponsored by:	Klara, Inc.
2022-02-10 11:34:52 -06:00
Richard Scheffenegger
3f169c54ab tcp: Add/update AccECN related statistics and numbers
Reserve couters in the tcps struct in preparation
for AccECN, extend the debugging output for TF2
flags, optimize the syncache flags from individual
bits to a codepoint for the specifc ECN handshake.

This is in preparation of AccECN.

No functional chance except for extended debug
output capabilities.

Reviewed By: #transport, rrs
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34161
2022-02-10 00:21:31 +01:00
Martin Matuska
833a452e9f 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

MFC after:	2 weeks
Relnotes:	yes
2022-02-10 00:35:42 +01:00
Simon J. Gerraty
a6f0e10b24 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'
2022-02-09 09:31:30 -08:00
Warner Losh
5e8e302087 systat: Eliminate write-only unit variable
Sponsored by:		Netflix
2022-02-07 14:51:45 -07:00
Warner Losh
d167318506 systat/iostat: Use bools for numbers and kbpt
These are really bools, declare them as such.

Sponsored by:		Netflix
2022-02-07 14:51:45 -07:00
Gordon Bergling
ecc467ebad ipsec(4): Fix a few typos in error messages
- s/receieve/receive/

MFC after:	1 week
2022-02-06 13:43:42 +01:00
Simon J. Gerraty
6598559fdf Update to bmake-20220204 2022-02-05 12:29:10 -08:00
Wolfram Schneider
610b97ebaa update external URL 2022-02-05 09:13:07 +00:00
Wolfram Schneider
153dd4ba03 fix URL typo 2022-02-05 09:08:45 +00:00
Wolfram Schneider
1c7a40d268 update external URL 2022-02-05 09:00:35 +00:00
Wolfram Schneider
c126924c8c update external URL 2022-02-05 08:58:30 +00:00
Wolfram Schneider
a6c20ddd4a switch from short to int for lookup table
This simplifies the code, less casting is needed.
2022-02-05 08:44:35 +00:00
Ed Maste
dbc7364b18 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
2022-02-04 21:05:10 -05:00
Stefan Eßer
c454c57163 whereis: fix fetching of user.cs_path sysctl variable
The current implementation of sysctlbyname() does not support the user
sub-tree. This function exits with a return value of 0, but sets the
passed string buffer to an empty string.

As a result, the whereis program did not use the value of the sysctl
variable "user.cs_path", but only the value of the environment
variable "PATH".

This update makes whereis use the sysctl function with a fixed OID,
which already supports the user sub-tree.

MFC after:	3 days
2022-02-04 23:44:34 +01:00
Wolfram Schneider
d43255b50c remove dead code
A lookup array is faster than a function with linear search.
The old function was not used for years - spring cleaning.
2022-02-03 17:02:37 +00:00
Wolfram Schneider
39a30a8097 better printf(3) format usage
Reported by: jhb
2022-02-03 16:57:25 +00:00
Michael Tuexen
6ad26abca5 sockstat: fix usage string
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2022-02-01 15:44:57 +01:00
Michael Tuexen
5f64777a4f 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
MFC after: 		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34137
2022-02-01 15:37:03 +01:00
Wolfram Schneider
792df7ced2 improve casting for pointer diffs 2022-02-01 17:26:20 +00:00
Wolfram Schneider
1536d37b20 fix casting issue in error message for 32bit CPUs (e.g. armv7) 2022-01-31 18:30:07 +00:00
Wolfram Schneider
d7e8005bfa cleanup documentation 2022-01-31 18:11:14 +00:00
Wolfram Schneider
00ad40d70a throw an error if reading from stdin failed 2022-01-31 18:04:45 +00:00
Wolfram Schneider
834a8fa169 enable to configure the locate path length at compile time
The length has not changed and is 1024 chars (equals PATH_MAX).

PR: 201243
Submitted by: Willem Jan Withagen <wjw@digiware.nl>
2022-01-31 17:32:46 +00:00
Wolfram Schneider
8d35ca86c5 Fix statistics for empty databases
An empty database is a database which does not contain any filenames.
It should not occur in practice but maybe in the case of an error.

echo | /usr/libexec/locate.mklocatedb > empty.db; locate -d empty.db -S
2022-01-31 17:03:08 +00:00
Wolfram Schneider
69ae5b9667 remove register
There are no measurable performance differences if registers are used or not.
2022-01-31 10:59:07 +00:00
Wolfram Schneider
33ee87fa0a improve error handling for corrupt database 2022-01-30 18:04:52 +00:00
Wolfram Schneider
5260fbcebd fix check for integer
For historical reasons, the integer is stored with an offset of plus 14.
That means, for a given max path length of 1024 the valid values
are -1009 .. 1037 and not -1023 .. 1023

PR: 201243
2022-01-30 16:27:27 +00:00
Wolfram Schneider
e7d6783f4a enable to set locate command 2022-01-30 16:24:49 +00:00
Wolfram Schneider
8e7c0a6d32 fix fgets error handling (from last commit) 2022-01-30 13:08:42 +00:00
Wolfram Schneider
72a0982cd5 improve error handling 2022-01-30 09:27:21 +00:00
Mateusz Piotrowski
1578c22e92 apply.1: Use Ar for arguments 2022-01-29 13:12:31 +01:00
Peter Jeremy
c9d1fa7003
systat: Display seconds in vmstat mode
Providing a timestamp with seconds granularity helps make it obvious
that the display is updating.

Reviewed by:    mckusick
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D29181
2022-01-29 20:41:19 +11:00
Wolfram Schneider
9146546eae locate statistics: show number of longest path in database 2022-01-29 07:13:28 +00:00
Wolfram Schneider
21cc4bee69 sync improvements from concatdb.sh
- stop on first error
- improve awk script: print the last two characters for bigram -  not the second word
- remove unnecessary checks
- use mktemp
- refactor
2022-01-29 07:12:09 +00:00
Mark Johnston
8d8b9b560a 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
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34081
2022-01-28 16:52:29 -05:00
Mark Johnston
41e6398f9b 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
2022-01-27 17:10:17 -05:00
Tom Jones
4669f23ef7 Remove SMALL conditionals from gzip
gzip has SMALL conditionals which enable building a reduced size version
of the binary. These exist as part of the introduction of BSD licensed
gzip in 2004 in NetBSD and appear to have been required to reach a size
for inclusion in their install media. For more information see commits
to gzip in the NetBSD tree on the 28th of March 2004.

SMALL doesn't appear to be hooked up to our build system and
complicates gzip quite a bit.

Reviewed by:	kevans,	imp
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34047
2022-01-27 17:27:21 +00:00
Tom Jones
21c966a6b9 Fix test output when gzip is run with -tlv
When run with test, verbose and list we need to parse the file otherwise
the test output is "NOT OK" even for the file is valid.

Reviewed by:	kevans, allanjude, imp
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34046
2022-01-27 17:20:23 +00:00
Wolfram Schneider
5cf0049653 limit sort(1) memory usage to 20% of available main memory
By default BSD sort(1) uses 90% (or at least 50%?) of the available
main memory. That is good for performance for a single job, but not
for a shared OS. For a long running script the performance is less
important than the stability of the server.  Also, if a server
with 64GB RAM starts swapping, the performance goes south and
hurts other running applications.

Note: this change does not affect the weekly cron job to
rebuild the locate database. The FreeBSD locate.updatedb
use the -presort option (find -s)
2022-01-26 19:30:11 +00:00