Commit graph

3863 commits

Author SHA1 Message Date
Olivier Cochard 161984ade1 tests: Fixing incomplete atf_skip if missing jail condition
Testing the scripts outside kyua(1) was a bad idea:
It didn't allow me to detect that they were faulty.

Sponsored by:	Netflix
2024-02-23 13:08:09 +01:00
Olivier Cochard 3562b7b1eb hostname(1): skip test if jail binary is missing
Approved by:	lwhsu
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D44005
2024-02-23 10:46:34 +01:00
Gordon Bergling ffea732c51 ls.1: Mention CLICOLOR environment variable
Mention CLICOLOR environment variable in the manual page.

PR:	276556
Submitted by:	bsdcode at disroot dot org
Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D43970
2024-02-21 11:54:58 +01:00
Warner Losh ef75877fc2 ls: Fix -v and associated test
The cleanup of d854370fa8 had a cut and paste error (so f_verssort
was set to 1 and then to 0 rather thame f_timesort being set to 0).

Fixes: d854370fa8
Sponsored by: Netflix
2024-02-19 09:50:04 -07:00
Ed Maste 05f530f4d2 cat: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Reported by:	asomers, markj
2024-02-14 19:37:54 -05:00
Chia-Jung Chang 90405e1d63
domainname(1): Grammar fix
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1038
2024-02-13 19:13:33 +08:00
Chia-Jung Chang 26cf4a61f6
hostname(1): Grammar fix
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1037
2024-02-13 19:02:17 +08:00
Chia-Jung Chang 8e9fc2d9f6
date(1): Grammar fixes
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1035
2024-02-13 19:00:59 +08:00
Chia-Jung Chang 416fdc2d71
cp(1): Grammar fix in comment
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1033
2024-02-13 18:53:50 +08:00
Chia-Jung Chang 304f52ad1b
df(1): Fix grammar
Event:		Advance UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1027
2024-02-13 18:31:05 +08:00
Chia-Jung Chang a400e25904
ed(1): Fix grammar in comment
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1025
2024-02-13 17:55:54 +08:00
HUNG-CHI CHANG 711a74e19f
pax(1): Grammar fix in file_subs.c
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/999
2024-02-13 15:09:32 +08:00
Fu-Cheng Wang 3cddabf0bd
sh(1): Grammar fix in jobs.c
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/992
2024-02-13 14:13:08 +08:00
Wilbert Allen Koeswoyo Suwito 84886bf93a
ed(1): Grammar fixes
- Adding a missing verb "is" on line 723
- Changing is to are on line 835

Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/986
2024-02-13 12:42:54 +08:00
Wilbert Allen Koeswoyo Suwito 8b6876e136
chio(8): Fix typo in the copyright section
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/978
2024-02-13 12:38:27 +08:00
Alexander Ziaee d854370fa8 ls: versort incompatible w/ timesort and sizesort
ls.1: versort incompatible w/ timesort and sizesort

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/825
2024-02-02 13:19:10 -07:00
Konstantin Belousov 2954af09f1 chflags(1): obey siginfo request on chflagsat(2) failure
Note that the error diagnostic can now be printed both to stderr due to
the absence of the -f flag and to stdout due to SIGINFO simultaneously.

Noted and reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-01-30 22:21:55 +02:00
Ricardo Branco fae467c221 chflags(1): Fix -f option
As stated in the man page, -f must not emit warning on error, and must
not set the utility exit code.

PR:	276723
Github PR:	https://github.com/freebsd/freebsd-src/pull/1088
Reviewed by:	imp, kib
MFC after:	1 week
2024-01-30 19:08:03 +02:00
Lin Lee 73974a78f7
hostname(1): Add test cases
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1069
2024-01-30 11:26:57 +08:00
Tom Hukins ba719a0fec Fix "version introduced" in numerous manual pages
MFC after:	1 week
Pull request:	https://github.com/freebsd/freebsd-src/pull/853
2024-01-08 11:35:16 -05:00
rilysh 4d8d9111a4 bin/timeout: remove unreachable break after usage()
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/872
2024-01-03 12:05:50 -07:00
rilysh 8312a902f9 bin/setfacl: remove unreachable break after usage()
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/872
2024-01-03 12:05:50 -07:00
rilysh e9910377a7 bin/cp: remove unreachable break
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/872
2024-01-03 12:05:50 -07:00
Pierre Pronchery 19bb1886be bsdinstall: rename "Live CD" to "Live System"
This uses more generic wording in the FreeBSD installer, when offering
the user to use the system booted without running the installer.

The updated wording is also reflected in freebsd-version(1).

Reviewed by:		emaste
Sponsored by:		The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D43233
2023-12-29 15:24:25 -05:00
Zhan-Wei 10b84b88f0 cat: Use present tense
Event: Advanced UNIX Programming Course (Fall23) at NTHU.
Reviewed by: imp, lwhsu
Pull Request: https://github.com/freebsd/freebsd-src/pull/923
2023-12-26 16:53:40 -07:00
Elyes Haouas fd4fafa873 timeout_test.sh: Fix typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/906
2023-12-26 16:41:15 -07:00
Kai-Yang Chen c1b12377a6 cat(1): Fix typo
Fix type: rebiuld -> rebuild in Makefile

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/933
2023-12-26 10:44:38 -07:00
Pei-Ju Chien c38fe1d282 sh(1): Fix typo
Remove extra 'ing' from 'bookinging.'

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/934
2023-12-26 10:44:35 -07:00
Kai-Yang Chen b6ae2ec7b0 sh(1): Fix typo
Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp, @rilysh on github
Pull Request: https://github.com/freebsd/freebsd-src/pull/935
2023-12-26 10:44:33 -07:00
WEININGCHIU 878bf23d37 sh(1): Fix typo
nozero -> non-zero

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Reviewed by: imp, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/936
2023-12-26 10:33:14 -07:00
Zhan-Wei f0d6447c0b pax: Add missing 'for' in comment.
Event: Advanced UNIX Programming Course (Fall23) at NTHU.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/941
2023-12-26 10:24:24 -07:00
Zhan-Wei ebb1fe4006 mv: Improve comment
Fix typo/grammar error: Use the singlar verb ending on exists.

Event: Advanced UNIX Programming Course (Fall23) at NTHU.
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/940
2023-12-26 10:24:22 -07:00
Pin-Yi Kuo e3d3e1ff7e df(1): fix a typo
On the manpage of df(1), "according" is mistyped into "acccording"

Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Signed-off-by: Pin-Yi Kuo <kuokuoyiyi@gapp.nthu.edu.tw>
Reviewed by: imp, zlei, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/944
2023-12-26 10:05:29 -07:00
Dag-Erling Smørgrav 53fc8e1902 cp: Move the -N flag in the manual page.
This accidentally got left out of 0f4467ce44.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43067
2023-12-14 21:02:06 +01:00
Dag-Erling Smørgrav 3850927066 cp: Further simplify the core logic.
If the destination file exists but we decide unlink it, set the dne
flag.  This means we don't need to re-check the conditions that would
have caused us to delete the file when we later need to decide whether
to create or replace it.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43064
2023-12-14 17:07:04 +01:00
Dag-Erling Smørgrav 0f4467ce44 cp: Move the flags around a bit.
- The HLPR flags are grouped together at the beginning because they are
  the standard flags for programs using FTS.  Move the N flag out from
  among them to its correct place in the sequence.
- The Pflag variable isn't used outside main(), but moving it out lets
  us skip initialization and keeps it with its friends H, L and R.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43063
2023-12-14 17:07:00 +01:00
Dag-Erling Smørgrav ac56b9d83c cp: Split the basic_symlink test case in two.
This test case tests two different things: first, that copying a symlink
results in a file with the same contents as the target of the symlink,
rather than a second symlink, and second, that cp will refuse to copy a
file to itself, or to a link to itself, or a link to its target.  Leave
the first part in basic_symlink, move the second part to a new test case
named samefile, and slightly expand both cases.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43062
2023-12-14 17:06:57 +01:00
Dag-Erling Smørgrav d002316fd7 cp: Refactor the core logic.
Rewrite `copy_file()` so the lflag and sflag are handled as early as
possible instead of constantly checking that they're not set and then
handling them at the end.  This also opens the door to changing the
failure logic at some future point (for instance, we might decide to
fall back to copying if `errno` indicates that the file system does not
support links).

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43055
2023-12-14 00:40:55 +01:00
Dag-Erling Smørgrav d3a8e9b43b cp: Add tests for symbolic link case.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, allanjude
Differential Revision:	https://reviews.freebsd.org/D43054
2023-12-14 00:33:37 +01:00
Dag-Erling Smørgrav 1fead66b64 cp: Add tests for hard link case.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D43052
2023-12-13 22:31:16 +01:00
Warner Losh 3e7e3b5bdf cp: Don't warn for chflags() failing with EOPNOTSUPP if flags == 0
From NetBSD's utils.c 1.5 importing importing BSDI change, with light
formatting changes:
    Author: cgd <cgd@NetBSD.org>
    Date:   Wed Feb 26 14:40:51 1997 +0000

    Patch from BSDI (via Keith Bostic):
    >NFS doesn't support chflags; ignore errors unless there's reason
    >to believe we're losing bits.  (Note, this still won't be right
    >if the server supports flags and we were trying to *remove* flags
    >on a file that we copied, i.e., that we didn't create.)

    CVS Info: utils.c 1.6

Obtained from:		NetBSD
Sponsored by:		Netflix

Differential Revision:	https://reviews.freebsd.org/D42674
2023-12-07 13:36:44 -07:00
Warner Losh 5a52e3d00d cp: Add -N flag, inspired by NetBSD's similar flag
Add -N to supress copying of file flags when -p is specified (explicitly
or implicitly). Often times we don't care about the flags or wish to be
able to copy to NFS, and this comes in handy for that. FreeBSD's and
NetBSD's cp are somewhat different, so I had to reimplement all but one
of the patch hunks...

Obtained from:		NetBSD (cp.1 1.25, cp.c 1.37, utils.c 1.28 by elad)
Sponsored by:		Netflix

Differential Revision:	https://reviews.freebsd.org/D42673
2023-12-07 13:36:44 -07:00
Mike Karels 1a7c9e1585 pwait.1: add missing prompt and command in examples
Two examples showed '$?' alone on a line, which should be '$ echo $?'.
The third example got it right.  Fix the first two.
2023-11-27 10:59:52 -06:00
Warner Losh e043f37205 bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:23:59 -07:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh 90aea514c6 bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Brooks Davis 1818f3fda9 ps: s/kern.max_pid/kern.pid_max/ in a comment
Sponsored by:	DARPA
2023-11-21 22:46:01 +00:00
Martin Matuska 3c773cad57 cat: fallback on EISDIR with copy_file_range(2)
The filesystem may support reading directories directly
when security.bsd.allow_read_dir is set.

MFC after:	1 week
PR:		275099
2023-11-19 02:14:50 +01:00
Thomas Eberhardt a6ed8c9593 Fix /root permissions after 'make installworld'
According to /etc/mtree/BSD.root.dist /root should have
0750 permissions, but the build target 'make installworld'
changes these to 0755.

This is caused by the installation of the configuration
files of sh(1) and csh(1).

Correct this by specifying the correct default /root permissions.

PR:	273342
Reviewed by:	jilles
Approved by:	jilles
MFC after:	2 weeks
Differential Revision:https://reviews.freebsd.org/D42395
2023-11-16 10:59:38 +01:00
Benedict Reuschling ba44650a0b ps.1: update regarding -D option and -p x/d interaction
The -p option does not imply -x, it is merely a different mode that ps
uses. Remove that statement from the -p option, effectively rolling back
d6ae056e9d.

pstef@ introduced the -D option in 5c0a1c15ff
which also turns ps into a similar mode. List the -D option along with
the others in the first sentence of the second paragraph of the
DESCRIPTION section for completeness and correctness sake.

Pointed out by:		pstef@
Differential Revision:	https://reviews.freebsd.org/D42552
2023-11-11 19:49:24 +00:00