| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory does not exist, set HOME=/.
Also adjust /root/.profile to stop setting HOME, since it should always
have been set now.
This is intended to keep shell startup files working in single-user mode
after /.profile has been removed.
Reviewed by: emaste, ivy, kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D52527
|
| |
|
|
|
|
|
|
|
| |
Now that stat(1) can report whether a file is sparse, we no longer need
a helper program for our tests.
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D52482
|
| |
|
|
| |
Requested by: kevans
|
| |
|
|
|
|
|
|
|
| |
When building without NO_ROOT, ${TAG_ARGS} is not set, which means we
pass ",config" as an install(1) argument. Only add the config tag if
${TAG_ARGS} is defined to begin with.
Fixes: aa730a66bc74 ("sh: Add config tag to /.profile")
Reported by: bz
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The file /.profile is installed as a hard link to /root/.profile. The
file in /root has the config tag, but the file in / does not, which
causes it to be overwritten by pkg upgrade. Since they're linked, this
also overwrites the file in /root.
Add the config tag to the file in / as well, so pkg treates both links
as config files and won't overwrite them.
PR: 289097
MFC after: 3 days
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D52162
|
| |
|
|
|
|
|
|
|
|
|
| |
* ISO 8601 defines two formats: basic and extended, clarify that we
output the extended format only.
* Clarify that ISO 8601 is only aware of timezone /offsets/, not timezones,
it has no relation to the Olson timezone database (TZ environment variable).
Reviewed by: otis (mentor), des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52314
|
| |
|
|
|
|
|
| |
Group options that can be used together accordingly in SYNOPSIS.
While here, tag SPDX and fix a parenthetical typo in EXAMPLES.
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
| |
The man page for freebsd-version describes four options and using the
distinction between two (using neither) does not apply in that context.
Change it to replace "neither" to fix the grammo.
PR: 265808
Event: Oslo Hackathon 2025
Approved by: des
Differential Revision: https://reviews.freebsd.org/D52180
|
| |
|
|
|
|
|
| |
Someone may be working on making a pkg backend for freebsd-update
so we can keep it.
This reverts commit e9792345d36c96dbb49f3ee996f75384a4cca532.
|
| |
|
|
|
|
|
|
|
| |
For the sunset of freebsd-update in 15.0R, remove a paragraph
claiming this utility should work even if using freebsd-update.
MFC: never
Reviewed by: 0mp, bcr
Differential Revision: https://reviews.freebsd.org/D51160
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
cpuset(1) implements a domainset(9) policy parser that is used to
translate a <policy>:<domain_list> string into a domainset_t mask
and a valid domainset policy. This change moves the domainset parsing
code into a new cpuset.c function - 'domainset_parselist'.
The existing cpuset.c code was refactored into a generalized list
parsing function which is now used to parse both CPU sets and domain
sets. This is the same approach used in cpuset(1).
Reviewed by: markj, ziaee (manpages)
Differential Revision: https://reviews.freebsd.org/D46607
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most libxo-enabled utilities link to xo_parse_args.3. But that man page
doesn't actually describe how to format command-line arguments. Rather,
xo_options.7 does. I suspect that these utilities link to the former
because the latter man page did not exist until libxo-0.7.2
(8a6eceff3ce). And newer utilities have probably been copy/pasting the
same text from older ones. But the superior man page does exist now,
so we should link to it instead.
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51354
|
| |
|
|
|
|
|
|
| |
While here, touch a few test cases up.
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51124
|
| |
|
|
|
|
|
|
|
|
| |
This adds a --sort option which makes cp pass a comparison function to
FTS, ensuring that sources are visited and traversed in a predictable
order. This will help make certain test cases more reliable.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51214
|
| |
|
|
|
|
|
|
|
| |
While here, fully switch boolean variables from int to bool, and clean
up the manual page a little.
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51213
|
| |
|
|
|
| |
Fixes: eb439266b433
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In normal operation, we get an FTS_D entry when we enter a directory
and a matching FTS_DP entry when we leave it. However, if an error
occurs either changing to or reading a directory, we may get an FTS_D
entry followed by FTS_DNR or even FTS_ERR instead. Since FTS_ERR can
also occur for non-directory entries, the only reliable way to keep
track of when we leave a directory is to compare fts_level to our own
depth counter.
This fixes a rare assertion when attempting to recursively copy a
directory tree containing a directory which is either not readable or
not searchable.
While here, also add a test case for directory loops.
Fixes: 82fc0d09e8625
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51096
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A script that does the following:
cd "${dir}" || exit 1
would incorrectly remain in the current directory when `${dir}` is
an empty string under the current implementation. This behavior,
while historical, is potentially dangerous, as it is likely not
what the script author intended.
Change the command to treat an empty string as an error and emit a
diagnostic message to standard error, as required by
IEEE Std 1003.1-2024.
PR: standards/287440
Test Plan: kyua test bin/sh
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D50974
|
| |
|
|
|
|
|
|
|
|
|
|
| |
More prominently note that we'll hide ancestors in the first two
paragraphs that provide an overview of pkill/pgrep. It also seems
worth noting in the description of -a that we won't ever unhide the
pgrep/pkill command itself, as mypid is skipped in all process iteration
by way of PSKIP().
Reviewed by: allanjude, des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51009
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This does not appear to make any practical difference at the moment, but
technically `O_PATH` means “I'm not going to use this descriptor for any
other purposes than vnode lookups”, so using it to read the directory's
ACLs is improper and might fail in the future.
Fixes: 82fc0d09e8625
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50984
|
| |
|
|
|
|
|
| |
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Fixes: 36679f7d7b56 ("kill: Use POSIX str2sig()")
Pull Request: https://github.com/freebsd/freebsd-src/pull/1733
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Change the origin from PZERO to PUSER.
Doing so allows users to immediately detect if some thread is running
under a high priority (kernel or realtime) or under a low one
(timesharing or idle).
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
| |
MALLOC_OPTIONS=J -> MALLOC_CONF=junk:true
PR: 287357
Reviewed by: markj
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50910
|
| |
|
|
|
|
| |
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1671
Closes: https://github.com/freebsd/freebsd-src/pull/1671
|
| |
|
|
|
| |
Reviewed by: imp, kib, des, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
|
| |
|
|
|
|
|
|
|
| |
In addition to verifying that ACLs and flags are copied with the -p
flag, verify that they are not copied without it.
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D50714
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
|
| |
|
|
|
|
|
|
|
|
|
| |
Switch to use waitid(2) to receive siginfo_t with the complete error
code from the exited process.
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the default disposition for SIGCHLD is ignore, the prematurely
exited child would cause SIGCHLD dropped. This makes timeout(1) hang,
because REAP_STATUS reports a zombie not waited for, but SIGCHLD for it
was already lost, so the main loop cannot exit, instead calling into
sigsuspend().
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
|
| |
|
|
|
|
|
|
| |
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
|
| |
|
|
|
|
|
|
|
|
|
| |
It is possible for the child to become zombie and then there is nothing
to signal.
Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50752
|
| |
|
|
|
|
|
|
|
|
| |
Since the bug we're testing involved path name construction, we don't
need to be root to test it; we can simply check the error message.
Fixes: 537fbf70f12b
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D50628
|
| |
|
|
|
|
|
|
|
|
|
| |
The trailing-slash logic would strip the target down to an empty
string, which we would then fail to stat, and subsequently attempt
(and fail) to create.
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D50604
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If the current umask is weird, ATF goes to great lengths to tell us that
it can't possibly work in these conditions, instead of just dealing with
it. This makes it unreasonably hard to use ATF to test how our own code
handles unusual umasks.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: igoro, kevans, ngie
Differential Revision: https://reviews.freebsd.org/D50267
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* At the end of copy(), we always close to.dir, even though it can be
AT_FDCWD (in the file-to-file case) or even -1 (if we failed to open
or create the destination directory). While closing an invalid file
descriptor is harmless, it's still bad form.
* In the DIR_TO_DNE case, initialize to.dir to -1 to guard against the
case where mkdir() fails so we never assign anything to to.dir and
end up (harmlessly, luckily) closing stdin on our way to the exit.
Coverity ID: 1609954
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50391
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If run as
alias ''
uninitialized memory could be referenced.
This is based on a fix from NetBSD. For more information, refer to
https://github.com/NetBSD/src/commit/10cfed82c28 .
Obtained from: NetBSD (Robert Elz <kre@netbsd.org>, 10cfed82c28)
MFC after: 3 days
Reported by: mckusick, Robert Elz <kre@netbsd.org>
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50364
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make to.base large enough to hold a trailing separator.
* Remove the separator from warning and error messages.
* In the FILE_TO_FILE case, leave to.base empty.
* In the FILE_TO_DIR and DIR_TO_DNE cases, append a separator to
to.base once we've (optionally created and) opened it.
* Thus, in the file-to-file case, we print an empty string followed by
to.path, while in all other cases, to.base already contains the
necessary separator.
This fixes failures in tests that used cp and expected a specific
error message and were surprised to see "./" pop up.
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50357
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Ensure that we are able to enter the destination directory after we
create it, even if the current umask would normally prevent it, and
that it has the expected permissions once we are done, even if we had
to tweak them to be able to enter it.
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50266
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The test case was a) not doing what I intended it to do and b) missing
a third possible configuration. Fix the test case, and fix the code
by not setting the beneath flag (which restricts operations to the
destination tree) unless we are recursing.
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D50257
|
| |
|
|
|
|
|
|
|
|
|
| |
* Correctly indent some comment blocks.
* Avoid using strcpy(), even when we know it's safe.
* Drop the (void) casts from fts_set() calls which can never fail.
Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D50256
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As stated in the previous commit, option '-J' was introduced by commit
"Add -J to filter by matching jail IDs and names."
(13767130c7147ae7182a, r265229), which unfortunately talked about '-J'
being a filter while actually implementing it as a regular selection
option which adds to the processes to display.
The manual page's formulation hinted more at '-J' being a filter, which
it is not, or could be just considered ambiguous, because of the
presence of the "only" word. Consequently, remove it and reformulate.
Reviewed by: ziaee, dch
MFC after: 1 day
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50194
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* As a general rule, follow symbolic links in the destination as long
as the target is within the destination hierarchy.
* As a special case, allow the destination itself to be a symbolic
link, and even a dead one (in which case we create the target).
* The file-to-file case remains unrestricted.
Currently, if a symlink we aren't allowed to follow is encountered,
cp will behave just like it would if the file was not writable. We
should consider whether it would be better to replace the offending
link instead.
Fixes: 0729d1e8fd90
MFC after: never
Relnotes: yes
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50093
|
| |
|
|
|
|
| |
Remove the double word "the the" from the sh(1) manual page.
MFC after: 3 days
|
| |
|
|
|
|
|
| |
Jump from one word to another. Not words to words.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1565
|
| |
|
|
|
|
| |
Noted by: lwhsu
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
| |
Where appropriate.
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is what POSIX mandates for option '-U' and arguably the behavior
that most users actually need in most cases. Before, '-U' would select
processes by their effective user IDs (which is the behavior mandated by
POSIX for option '-u').
Matching by real user IDs allows to list all processes belonging to the
passed users, including those temporarily having a different effective
user ID, which can happen if launched by a setuid executable or if using
some credentials-changing facility (such as seteuid() for root processes
or mac_do(4)/setcred(2)). Conversely, processes temporarily assuming
the identity of some of the passed users will not be listed anymore
(they do not "belong" to these users).
This change also makes '-U' consistent with '-G', the latter already
matching on real group IDs.
While here, remove the (non-compiled) code for tentative option '-R' as
its proposed behavior was the one established here for '-U'. Also, move
the compiled-out old code for '-U' under '-u' for reference, as this is
what the latter should do according to POSIX, even if it seems unlikely
we will want to change the behavior of '-u'.
Reviewed by: manpages (ziaee)
MFC after: 3 days
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49622 (code)
Differential Revision: https://reviews.freebsd.org/D49623 (manual page)
|
| |
|
|
|
|
| |
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49621
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This puts our ps(1) in conformance with POSIX.
While here, replace ad-hoc initialization of 'uidlist' with a call to
expand_list().
***
Review of the ps(1) implementations in other BSDs, illumos, and Linux's
procps shows they already behave as prescribed by POSIX.
Previously, we would match processes with their effective user ID but
using our real user ID. While the real user ID is meant as the real
identity of a process, and is used, e.g., to perform accounting or be
permitted to send signals to specific targets, selecting processes to
display is arguably more akin to a kind of (advisory) access control.
ps(1) is not installed setuid, so normally the real and effective user
IDs of ps processes are the same. This may however not be the case when
ps(1) is launched by another setuid executable, and the launching
process may then logically expect that ps(1) lists the processes
corresponding to its effective UID.
MFC after: 3 days
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49619 (code)
Differential Revision: https://reviews.freebsd.org/D49620 (manual page)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When combined with other options affecting the selection of processes,
except for '-X' and '-x', option '-a' would have no effect (and '-A'
would reduce to just '-x'). This was in contradiction with the rule
applying to all other selection options stating that one process is
listed as soon as any of these options has been specified and selects
it, which is both mandated by POSIX and arguably a natural expectation.
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49617 (code)
Differential Revision: https://reviews.freebsd.org/D49618 (manual page)
|