Firstly, my review comments were not addressed and instead totally
ignored. Secondly, and a more valid justification for the revert, this
completely breaks the installer, since selectdists isn't installed.
Given the blatant lack of testing, back out this commit until it has
actually been tested and review comments taken on board so that the
installer actually works.
This reverts commit 009d3f66cb.
The -l flag was used to tell traceroute6(8) to show both hostname and
address for each hop. However, traceroute(8) already does this by
default, and there's no reason for traceroute6 to behave differently.
Make this the default behaviour, and accept -l for backward
compatibility as a no-op flag.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1023
- 223.backup-zfs would previously honour the daily_backup_zfs_verbose
flag for zfs/zpool list, but not for the properties list. fix it to
show a diff for both of these if requested.
- if daily_backup_zfs_verbose was disabled, 223.backup-zfs would still
set rc=1 if the backup files changed, which caused periodic(8) to send
a useless email even if daily_show_success=NO was set.
change this so that it only sets rc=1 if diff output is enabled, i.e.
the output is actually useful to the admin.
MFC after: 2 weeks
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1091
Rather than assuming that the "root" is passed as directory and will be
marked by a trailing slash, we just assume that the directory, which has
been checked previously to be a directory, is a directory.
This fixes an inconsistency between `kldxref /boot/modules`, which tries
to create the temp file in `/boot/`, and `kldxref /boot/modules/`, which
tries to create it in `/boot/modules/` itself.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1093
The current macro always builds a full mask for a named field, so use
the M suffix for mask.
Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43601
This is not a functional change, but just being consistent instead of
omitting a shift by 0.
Reviewed by: corvink, chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43600
New users may refer to service(8) to discover how to manage services,
but this manpage does not explain which commands are permitted besides
start/stop (for example, 'enable'). Add a paragraph that directs the
reader to rc(8) to discover this.
While here, add a few examples of common use-cases.
Reported by: Mina Galić <freebsd@igalic.co>
Pull request: https://github.com/freebsd/freebsd-src/pull/1057
kldxref anything whose name doesn't end in .ko or that has no dots (eg
the kernel).
Sponsored by: Netflix
Reviewed by: jrtc27, jhb
Differential Revision: https://reviews.freebsd.org/D43507
I observed the problem on a system with fairly old and, apparently,
buggy EFI implementation. A list of boot devices had an invalid
trailing entry. efidp_size() for that entry returned zero, which means
that the code got stuck looping on that entry.
newfs always sets sectorsize to DEV_BSIZE (512) and derives some other
values based on the number of 512-byte sectors per real sector. Similar
logic is required in makefs. Until that happens, emit a warning that
the image may be incorrect.
PR: 276571
In particular:
- Stop assuming that the breakpoint size is one byte.
- Avoid referencing the "rip" field in machine-independent code, use a
helper.
No functional change intended.
Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43483
It's awkward to have separate tables for information which is logically
connected. Merge the gdb_regset[] and gdb_regsize[] arrays and update
gdb_read_regs() to cope with the result. This makes the addition of
arm64 support a bit cleaner.
No functional change intended.
Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43481
When generating a VM image from an installworld mtree manifest, makefs
spits out several thousand warnings about duplicate paths in the
manifest. These are harmless and have been around for a long time (see
the phabricator revision for some more details), so let's at least have
a way to make makefs quieter.
Reviewed by: brooks, imp, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43513
Add zfs.dataset to jail(8) to add a list of ZFS datasets.
Bump FreeBSD version for jail managers to switch to native
dataset support.
Datasets are attached to the jail after the jail creation and
before the execution of any start command. Unlike current
implementations in jail managers which attach datasets after
the start command, this allows the zfs rc.d script to mount
the datasets on start.
Discussed with: jamie
1. In basl_load() function, when allocation fails,
it returns an EFAULT instead of ENOMEM. An EFAULT
can mislead in some scenarios, whereas an ENOMEM
for an allocation function makes much more sense.
2. Call free() on addr, as it's not being used
anymore after the basl_table_append_bytes()
function.
Signed-off-by: rilysh <nightquick@proton.me>
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1016
Add a python script which implements the bulk of this functionality.
Over time, this would ideally evolve into a library of python routines
which can be used to inspect kernel data structures and automate some
debugging tasks, similar to jhb's out-of-tree scripts, but written in a
somewhat nicer language and with better integration into the kgdb
command prompt.
Note that kgdb currently won't auto-load scripts in this directory.
This should perhaps change in the future. It probably also makes more
sense to have a crashinfo.py which provides all the kgdb output that we
want to include in core.txt, rather than having crashinfo.sh pipe in
several commands.
Reviewed by: avg, imp
Discussed with: jhb
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33817
The USB3 spec mandates that the device-descriptor max packet size
be 512 bytes, which requires a field size of 9 since it is a
power-of-2.
Linux kernels recently started validating this field, resulting in
the table not being probed and the cursor not working in bhyve VNC.
Reviewed by: corvink
PR: 275760
MFC after: 1 week
The situation is improved now that we're running in a sandbox, but there
is still some host machine access that could be concerning depending on
the context. These concerns may be somewhat mitigated by the fact that
the host machine usually provides the loader binary, even when the guest
image is providing the loader scripts -- they only bring the lua
scripts, and they have to be able to execute arbitrary syscalls rather
than the interfaces provided by libsa(3).
Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D43299
The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.
PR: 253168
Reviewed by: delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43357
Existing powerpc kernels include additional sections beyond .dynamic
in the PT_DYNAMIC segment. Relax the requirement for an exact size
match of the section and segment for PowerPC files as a workaround.
Reported by: jrtc27
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43123
This allows writing setup scripts that contain lines starting with
"#!", e.g., a shebang when creating a shell script using cat:
#!/bin/sh
echo "Populate rc.local"
cat >/etc/rc.local<<EOF
#!/bin/sh
echo booted | logger -s -t 'example'
EOF
Prevent accidentally running a setup script left behind by a
previous invocation of bsdinstall.
Reviewed by: imp, jrtc27
Differential Revision: https://reviews.freebsd.org/D43350
In belatedly fixing a mistake made in fbbdfa2b8a, I noticed that igor
and mandoc -Tlint had a few more things to say.
As such, I'm reflowing a few lines and fixing a contraction.
MFC with: fbbdfa2b8a
I forgot to do it when making the commit, so hat-tip to asomers@
Reported by: asomers@
Fixes: fbbdfa2b8a (nfsv4(4): mention the nfsv4_server_only..)
MFC with: fbbdfa2b8a
In the case of hostbase_fd, this is infact a bug fix; we have a seek
callback that the host: filesystem may use in loader, and we really
don't have a good excuse to break it.
bootfd-derived fds will only be used with fdlopen(3) and rtld doesn't
seem to need pread / lseek at all for it today, but there's no reason to
break if it finds a good reason to later.
Suggested by: markj
Previously we used a mix of perror(3) + exit(3) and err(3); standardize
on the latter instead. This does remove one free() in an error path,
because we're decidedly leaking a lot more than just the loader name
there (loader handle, vcpu, vmctx...) anyways.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43331
TCP endpoints in TIME_WAIT are not handled in a special way anymore.
Therefore, they can be handled now by tcpsso.
Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D43351
Add note about configuring the NFSv4-only option.
It is already mentioned in rc.conf(5), but documenting it here makes it
more likely that people see it when they need it.
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1008
userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader
command is executed. Use that and longjmp back to reinit the VM
entirely with a reboot request. This fixes the 'reboot' option in the
loader menu to actually reboot rather than shutdown the VM.
The JMP_* constants are introduced to keep track of why we're doing a
longjmp, though they aren't currently used. We'll notably still do a
complete reload of the interpreter to give the rebooted VM that new
loader smell. It just seemed forward thinking to just keep track of the
different setjmp points.
While we're here, we don't actually need to keep the fd we passed to
fdlopen(3), so let's avoid leaking it.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43300
In neither case do we need write access to the directories we're working
with; userboot doesn't support fo_write on the host device, and the
bootfd is only ever needed for loader loading.
This improves on 8bf0882e18 ("bhyveload: enter capability mode [...]")
so that arbitrary code in the loader can't open writable fds to either
of the directories we need to maintain access to.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D43315
explicit_loader_fd should have been initialized to -1, not 0, but my
last round of testing was only with -l...
Fixes: bf7c4fcbbb ("bhyveload: hold /boot and do relative [...]")
Pointy hat: kevans
The next change will push bhyveload into capability mode right after we
allocate vcpu state, before we've setup or entered the loader, to limit
the surface area that a rogue loader script can touch.
With an explicit -l loader, we don't need to preopen /boot because
changing interpreters isn't allowed. We'll just dlopen() entirely in
advance in that case to eliminate some complexity.
Reviewed by: allanjude (earlier version), markj
Differential Revision: https://reviews.freebsd.org/D43285
Don't allow lookups from the loader scripts, which in rare cases may be
in guest control depending on the setup, to leave the specified host
root. Open the root dir and strictly do RESOLVE_BENEATH lookups from
there.
cb_open() has been restructured a bit to work nicely with this, using
fdopendir() in the directory case and just using the fd we already
opened in the regular file case.
hostbase_open() was split out to provide an obvious place to apply
rights(4) if that's something we care to do.
Reviewed by: allanjude (earlier version), markj
Differential Revision: https://reviews.freebsd.org/D43284
Explicit Congestion Notification (ECN) is a mechanism that allows
end-to-end notification of network congestion without dropping packets
by explicitly setting the ECN code point (2 bits).
Per RFC 8087, section 3.5, network devices should not be configured to
change the ECN code point in the packets that they forward, except to
set the CE (Congestion Experienced) code point ('11') to signal
incipient congestion.
The current commit adds an -E flag to traceroute6 that crafts a packet
with an ECT(1) code point ('01').
If the packet is received back with a zero ECN code point ('00'), it
outputs that the hop in question erases or "bleaches" the ECN code point
values. Bleaching may occur for various reasons (including normalizing
packets to hide which equipment supports ECN). This policy prevents the
use of ECN by applications.
If the packet is received back with an all-ones ECN code point ('11'),
it outputs that the hop in question is experiencing "congestion".
If the packet is received back with a different ECN code point ('10'),
it outputs that the hop in question changes or "mangles" the ECN code
point values.
If the packet is received with the same ECN code point that was sent
('01'), it outputs that the hop has "passed" the ECN bits appropriately.
Inspired by: Darwin
Reviewed by: imp, markj
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/879
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.
Make, by default, daily diff(1) ignore whitespace changes and the unified output
a context of zero (0) lines. This reduces output of unrelated lines in e-mails
delivered to root.
PR: 270266
Approved by: jrm (mentor), karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D42762
Make, by default, security diff(1) produce a unified output with a context of
zero (0) lines. This reduces output of unrelated lines in e-mails delivered
to root.
PR: 270266
Approved by: jrm (mentor), karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D43071
The upper limits for height/width are already checked, this commit
enforces the lower limit as well.
The behavior is also changed such that, the framebuffer fails to
initialize if the provided values don't parse cleanly.
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D42692
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
After commit fb51ddb20d, suspending a vm fails with the error:
vm_snapshot_buf: buffer too small
Sponsored by: vStack
Reviewed by: markj, rew
Fixes: fb51ddb20d ("bhyve: increase fbuf display resolution limit")
Differential Revision: https://reviews.freebsd.org/D43218
Administrators can now specify a global compression method directly
at the beginning of the newsyslog.conf file, for example:
<compress> none
Relnotes: yes
Reviewed by: dvl
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43174
* Don't segfault when parsing a misformatted auth-group section
* If the config file specifies a chap section within a target but no
auth-group, create a new anonymous auth-group. That matches the
behavior with non-UCL config files.
* Protect some potential segfaults with assertions
PR: 274380
MFC after: 1 week
Sponsored by: Axcient
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D43198
Re-wrap the read(2) line, and make the listen_child loop more explicit
in intent.
Reported by: kib
Fixes: 6ac7c9f06a ("daemon: remove redundant parameter from [...]")
Looping over lines in the buffer is not needed.
Same effect can be achieved by looking for the last new line.
If found the buffer is guaranteed to have one or more complete lines.
All complete lines are flushed at once with no looping.
Reviewed by: cperciva, kevans
There is no reason for a buffer in listen_child()
to be a static function variable. The buffer and
its position are parts of the daemon state and should
live together with the rest of the state variables.
Reviewed by: cperciva, kevans
Fixed narrowing conversions:
- strtol replaced with strtonum with range check
- read returns ssize_t
- kevent.data explicitly cast to int before passing into strerror
While we we're here:
- Defined and documented maximum restart delay.
- Fixed typo in a comment.
- Remove unused includes
Reviewed by: cperciva, kevans
The default for discoverable is 'NO' not 'YES'. This now matches the man
page.
Event: Advanced UNIX Programming Course (Fall'23) at NTHU.
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/939
In the function audio_init(), strlen() is being called two times,
first to get the length of dev_name and second to use in memcpy().
Creating a local variable and keeping the length avoids this
re-calculation.
Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/945
Historically, newsyslog compressed rotated log files to save disk space.
This was useful in the early days. However, with modern file systems like
ZFS offering native compression, and with the availability of larger hard
drives, the benefits of additional compression have become less significant.
This is particularly true considering the inconvenience of decompressing
log files when searching for specific patterns.
Additionally, the original implementation of compression methods was not
future-proof. As a result, we have redefined the J, X, Y, Z flags to
signify "treat the file as compressible" rather than "compress the file
with that specific method."
A new command-line option, -c, has been introduced to allow overriding
these settings in a more future-proof way. The available choices are:
* none - do not compress, regardless of flag.
* legacy - historical behavior: J=bzip2, X=xz, Y=zstd, Z=gzip.
* bzip2, xz, zstd, gzip - apply the specified compression method.
Currently, the default is set to 'legacy' to preserve historical behavior.
However, our intention is to change this default to 'none' in FreeBSD 15.0.
Additionally, this update changes the default settings for zstd to use
multithreading and long-range options, better aligning with its intended
use.
Inspired by D42961 .
Reviewed by: debdrup (earlier version, mdoc(7))
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43165
Commit 7c5146da12 modified mountd so that it uses
strunvis(3) to decode directory names in exports lines.
This allows special characters, such as blanks, to be
encoded in the directory names.
This patch updates the exports.5 man page for this change.
This is a content change.
Reviewed by: karels, pauamma_gundo.com (manpages)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42163
While parsing .dynamic, nsym is set when parsing the symbol table from
.dynsym. That parsing also sets ef->ef_symtab to a non-NULL value.
The value of nsym isn't validated until after a check for
ef->ef_symtab being NULL, so nsym always has a valid value when it is
read. However, that chain of events is a bit much for static analysis
to follow, so initialize nsym to 0 before parsing sections to quiet
the warning.
Reported by: Coverity Scan
CID: 1532339
Sponsored by: DARPA
Unlike the backend for ELF DSOs, the object file backend allocated an
aligned chunk of memory and read all of the in-memory sections from
the file into this memory even though most of the file contents were
never used. Instead, just track a set of virtual addresses (based at
0) that each loaded section would be loaded at and only read the
necessary bits from the backing file when needed.
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43126
Use pread as a valid offset is always passed now. Originally the DSO
code read the .hash section in two separate requests and relied on the
implicit offset for the second read, but now the hash table is fetched
in a single call.
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43125
Apparently 19eaa01bea inserted -K description in the middle of -k.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D43164
Report the entire path to the device, rather than the the bit after /dev/
for the --esp command. Nothing in the tree depends on the output
format: Only bsdinstall's bootconfig script calls efibootmgr, and it
doesn't use the --esp/-E flag.
Sponsored by: Netflix
-e env will include `env` in the boot loader. Document that the boot
loader appends the `env` to the BootXXXX variable, and will parse it as
a series of a=b values to set in the boot loader's environment. These
assignments are separated by spaces. The env arg needs to be quoted if
more than one env var is to be set (we parse only the next argument on
the command line).
Sponsored by: Netflix
Note that relbase is always 0 for DSOs so its omission for __KLD_SHARED
architectures was not a bug in practice.
Whilst here, also parenthesise the dest offset for where to avoid
transiently creating an out-of-bounds pointer, which is UB (though even
on CHERI architectures, where capability bounds compression can result
in that creating invalid capabilities that will trap on dereference,
optimisation will reassociate to the correct form in practice and thus
work just fine).
R_PPC_RELATIVE lost its 32-bit handling in the libelf conversion.
Reported by: bapt
Fixes: 0299afdff1 ("kldxref: Make use of libelf to be a portable cross tool")
This allows kldxref to operate on kernel objects from any
architecture, not just the native architecture. In particular, this
will permit generating linker.hints files as part of a cross-arch
release build.
- elf.c is a new file that includes various wrappers around libelf
including routines to read ELF data structures such as program and
section headers and ELF relocations into the "generic" forms
described in <gelf.h>. This file also provides routines for
converting a linker set into an array of addresses (GElf_Addr)
as well as reading architecture-specific mod_* structures and
converting them into "generic" Gmod_* forms where pointers are
replaced with addresses.
- The various architecture-specific reloc handlers now use GElf_*
types for most values (including GElf_Rel and GElf_Rela for
relocation structures) and use routines from <sys/endian.h> to read
and write target values. A new linker set matches reloc handlers
to specific ELF (class, encoding, machine) tuples.
- The bits of kldxref.c that write out linker.hints now use the
encoding (ELFDATA2[LM]SB) of the first file encountered in a
directory to set the endianness of the output file. Input files
with a different architecture in the same directory are skipped with
a warning. In addition, the initial version record for the file
must be deferred until the first record is finished since the
architecture of the output file is not known until then.
- Various places that used 'sizeof(void *)' throughout now use
'elf_pointer_size()' to determine the size of a pointer in the
target architecture.
Tested by: amd64 binary on both amd64 and i386 /boot/kernel
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42966
- Add a free_pnp_list to complement parse_pnp_list. Add freeing
of 'new_desc' which was previously leaked.
- Move body of loop that checked a single pnp list element against a
table entry into a parse_pnp_entry function to reduce indentation
and split parse_entry into a smaller function.
- Similarly, split out a record_pnp_info function from parse_entry
which builds the pnp_list and walks a table.
Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42965
This was originally used (along with FREEBSD_AOUT) to prefer the use
of ELF in various tools instead of a.out as part of the a.out to ELF
transition in the 3.x days. The last use of it was removed from
<link.h> in commit 66422f5b7a back in
2002, but various files still #define it.
Reviewed by: kevans, imp, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42964
This uses the statement from other files in kldxref when the tool was
first imported in commit 9c6f92408c.
Reviewed by: kevans
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42963
This patch refactors the existing Intel-specific single-stepping
mechanism in bhyve's GDB stub to work with both AMD and Intel CPUs.
Reviewed by: jhb
Sponsored by: Google, Inc. (GSoC 2022)
Differential Revision: https://reviews.freebsd.org/D42298
Currently we just strip the .txz of the dist name (and add a status_
prefix) to get the shell variable name for its status, but this doesn't
give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg,
or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As
a result, four things go wrong for such dists:
1. If there is a dot and/or a dash in the name, writing to the variable
fails and spits an error out on stderr to the log
3. If there is a dot in the name before any dash, the syntax is always
invalid, reading the variable fails, spits an error out on stderr to
the log, the result is the empty string and that is interpreted as
being 0%
2. If there is a dash in the name before any dot, and there is a dist
whose name is the substring up to that first dash, and it has already
had its status written to, reading the variable instead reads that
dist's variable and so the status of that dist is displayed instead
3. If there is a dash in the name before any dot, and either there is
not a dist whose name is the substring up to that first dash or there
is such a dist but it has not already had its status written to,
reading the varaible instead results in the substring after the first
dash, including any additional string expansion syntax that follows
(i.e. ${status_kernel-dbg:--11}, the expression used to read the
variable, is interpreted as reading status_kernel with a default
value of "dbg:--11")
For example, in a default install with base, kernel, kernel-dbg and
lib32, the following sequence of displays happens:
1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows
for the garbage input "dbg:--11") and lib32 is Pending
2. base is Passed, kernel is In Progress, kernel-dbg is In Progress
(since kernel has now had its status written to) and lib32 is
Pending
3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since
that is the status of kernel, despite that kernel-dbg is being
verified at this point) and lib32 is Pending
4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is
In Progress
Fix this with a crude encoding scheme. More special characters can
easily be added if needed in future.
Note that, prior to bsddialog being used (and thus for branches this is
MFC'ed to where dialog is still used), the same problem existed but
displayed slightly differently due to a combination of different default
values and different behaviour for unintended inputs.
Fixes: b70047d413 ("Add generation of an installation manifest containing SHA256 checksums as ...")
MFC after: 1 week
Users of autofs for removable media expect to be able to copy files and
directly remove the media without having the need to call sync(8) or umount(8).
Only do that for fat/ntfs filesystems.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D42494
Reviewed by: rew (older version)
when ntpd is enabled.
The leap-seconds.list is used exclusively by ntpd, therefore, do not bother
to perform the fetch when ntpd is not enabled.
PR: conf/275419
Reviewed by: cy, michaelo, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42875
Currently, a prison in "dying" state (removed but still holding
resources) can be brought back to alive state via "jail -d", or
the JAIL_DYING flag to jail_set(2). This seemed like a good idea
at the time.
Its main use was to improve support for specifying the jid when
creating a jail, which also seemed like a good idea at the time.
But resurrecting a jail that was partway through thr process of
shutting down is trouble waiting to happen.
This patch deprecates that flag, leaving it as a no-op for creating
jails (but still useful for looking at dying jails). It sill allows
creating a new jail with the same jid as a dying one, but will renumber
the old one in that case. That's imperfect, but allows for current
behavior.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D28150
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
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
For the uncommon items: Go through the tree and remove sccs tags that
didn't fit any nice pattern. If in the neighborhood, other SCM tags were
removed when they were detritis of long-ago CVS somehow in the early
mists of the project. Some adjacent copyrights stringswere removed (they
duplicated the copyright notices in the file). This also removed
non-standard formations of omission of SCCS tags (usually by adding an
extra #if 0 somewhere.
After this commit, a number of strings tagged with the 'what' @(#)
prefix remain, but they are primarily copyright notices.
Sponsored by: Netflix
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
The iostat(8) manual page should be more specific when using
options. Also extented the BUGS section.
PR: 153012
Reviewed by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42633
We already have nosuid option in auto_master so no need to redefine it.
Also it's easier for a user to modify the auto_master configuration file
than the script (which shouldn't be modified).
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D42492
Reviewed by: rew
Using a symlink means that new timezone data (installed by an errata
update, say) will be usable without having to be copied again.
Reviewed by: bapt, kevans, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37005
This enables a subset of the functionality provided by QEMU's user
networking implementation. In particular, it uses net/libslirp, the
same library as QEMU.
libslirp is permissively licensed but has some dependencies which make
it impractical to bring into the base system (glib in particular). I
thus opted to make bhyve dlopen the libslirp.so, which can be installed
via pkg. The library header is imported into bhyve.
The slirp backend takes a "hostfwd" which is identical to QEMU's
hostfwd. When configured, bhyve opens a host socket and listens for
connections, which get forwarded to the guest. For instance,
"hostfwd=tcp::1234-:22" allows one to ssh into the guest by ssh'ing to
port 1234 on the host, e.g., via 127.0.0.1. I didn't try to hook up
guestfwd support since I don't personally have a use-case for it yet,
and I think it won't interact nicely with the capsicum sandbox.
Reviewed by: jhb
Tested by: rew
MFC after: 1 month
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D42510
Currently the net_backend structure definition is private to
net_backends.c, so all of the backend definitions are there. While
adding a new backend to use libslirp, it was noted that this file is
somewhat cluttered. Move the netmap and netgraph backends to their own
files and clean up includes a bit. No functional change intended.
Reviewed by: corvink, jhb
MFC after: 3 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D42689
This enables connecting to the VNC server at a higher resolution.
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D42620
This variable does not set the exact sector size of the pool, but
controls the minimum sector size. The sector size of the underlying
disks can always be larger than the minium controlled by this knob.
PR: 274513
Reported by: Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz>
Only set a default value of 1 if the shell variable is unset. This allows
installer scripts to disable the variable.
PR: 274513
Reported by: Albin "a12l" Otterhäll <bugs.freebsd.org@a12l.xyz>
Differential Revision: https://reviews.freebsd.org/D42319
Previously the local ABI string was written to an on-stack buffer and
the pointer to that buffer was saved in a global before the function
returned. This had two issues: c[ABI].val pointed to a
no-longer-valid on-stack buffer after config_init returned, and the
string could potentially be truncated. Fix both of those by changing
pkg_get_myabi to return a pointer to a string allocated by asprintf.
Note that the allocated string is left in the global config array
until it is implicitly freed on process exit.
Reported by: GCC 13 -Wdangling-pointer
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42623
This function temporarily stores a pointer to an on-stack variable (a
TAILQ_HEAD of a temporary list) into a global variable (*n).
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42581
"keep" currently adds a leading underscore, which hasn't been useful or
accurate since a.out days. Preserve the symbol name as it's given
rather than mangle it to match ELF-style symbol names.
This was partially fixed back in
6cd35234a0 ("Assume ELF-style symbol names now.") for crunchgen, but
the keeplist wasn't changed to match it.
While we're here, break it out to bsd.crunchgen.mk for later use in
bsdbox.
Reviewed by: adrian, imp
Differential Revision: https://reviews.freebsd.org/D42499
This ensures that certificate files or bundles with DOS or Mac line
endings are recognized as such and handled identically to those with
Unix line endings.
PR: 274952
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D42490
This should make crash reports a bit more useful without having to ask
for additional information.
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42465
We have not had gdb 6.1 in the base system for some time; there is no
need to check for it.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34478
The previous code would correctly parse strings including quotation
marks (") or backslash (/), but the tests when creating the export
includes them in the final string. This prevents exporting paths
with embedded spaces, for example "/exports/with space". Trying
results in log lines resembling:
mountd[1337]: bad exports list line '/exports/with\ space':
/exports/with\ space: lstat() failed: No such file or directory.
Turns out that when creating its exports list, zfs escapes strings
in a format compatible with vis(3). Since I expect that zfs sharenfs
is the dominating use case for generating an exports list, use
strunvis(3) to parse the export path. The result is lines like the
following allowing spaces:
/exports/with\040space -network 192.168.0 -mask 255.255.255.0
A man page update will be done as a separate commit.
MFC after: 1 month
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D42432
Upstream is now https://github.com/zoulasc/blocklist/. Rename the
contrib directory and update Makefiles to match, in advance of the next
vendor branch update.
Sponsored by: The FreeBSD Foundation
Implement PS2 Keyboard command 0xf6, which is "SET DEFAULTS". This is
the same as 0xf5 (DISABLE KEYBOARD), but without disabling the keyboard
(since that resets all the defaults as a side effect). Normally, we
clear the fifo when we re-enable the keyboard. However, since this
leaves the keyboard enabled, clear the fifo as part of this command and
send an ack.
Linux's keyboard driver sends this command on reboot. Other commands
enable / reset the kebyoard, so it doesn't matter too much this isn't
implemented for booting, eg ubuntu.
Sponsored by: Netflix
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D42384
Many sysadmins prefer to configure their systems to UTC and it's a
reasonable default when installing, making it easier to get a usable
system by just hitting <return> repeatidly.
Renumber UTC to 0 to preserve the finger memory of those selecting a
region by shortcut.
Reviewed by: jrtc27, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42383
-C isn't implemented, so just errx out until it is. It's not listed in
the man page, but is parsed for compatibility with the Linux
efibootmgr(8) command.
Sponsored by: Netflix
ioctl(2)'s with integer argument shall pass command argument by value,
not by pointer. The ioctl(2) manual page is not very clear about that.
See sys/kern/sys_generic.c:sys_ioctl() near IOC_VOID.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D42366
Fixes: fd8b9c73a5
Commit 428879dc91 adds a requirement for a new upcall for the
gssd(8). This patch adds that upcall.
Unfortunately, the old gssd.c would not build against the new
patched gssd.x.
This patch will fix the build.
MFC after: 1 month
This patch restores/fixes some of the behavior present in pre-netlink ndp(8).
1. Deleting a local address now correctly returns EPERM (instead of
ENOENT)
2. ndp -c no longer dumps the entire table while complaining about
local addresses
3. Return exit code when deleting entry (e.g. trying ndp -d on a local
address is an error)
Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42316
This is required for the "used", "usedds" and "usedchild" dataset
properties to be displayed.
PR: 274613
Reported by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Readd bsddialog(1) to bsdconfig(8).
This can be considered an increment not a replacement: `$DIALOG=dialog'
restores dialog(1), no change for Xdialog(1). An exception is if an
error occurs, bsddialog(1) replaces dialog.
Configuring a FreeBSD laptop, my fingers kept wanting to type
`bsdconfig network' and I could not figure out why this was not working.
Took me a second to realize that the shortcut was `bsdconfig networking'
for where I wanted to go.
Reviewed by: jhb
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D42242
Document the LOCALBASE variable and that it's set to user.localbase by
default. Update path defaults that depend on it.
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D40529
- If an untrusted certificate is also found in the list of trusted
certificate, issue a warning and skip it, but don't fail.
- Split on -+BEGIN CERTIFICATE-+ instead of "Certificate:" since
that's what we're really looking for.
Also fix a long-standing bug: .crl files are not certificates, so we
should not include them when searching for certificates.
Reported by: madpilot, netchild, tijl
Reviewed by: netchild, allanjude
Differential Revision: https://reviews.freebsd.org/D42276
Restore bsdconfig API to handle hostname dialog because bsddialog 1.0
matches all features required by bsdconfig(1). Implicitly this commit
restores also Xdialog(1) for this script.
This commit reverts:
- "bsdinstall hostname: Replace dialog with bsddialog"
6368dcb292
- "bsdinstall(8) hostname: Update for bsddialog 0.3"
5f3ec44e7e.
The script continues to use bsddialog(1) by default via $DIALOG in
bsdconfig(1).
When a conflict marker is found during update allow the user to confirm
they want it to remain in the file.
Suggested by: Tim Hogard
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Fixes: ceb5f28ba5 ("freebsd-update: re-edit files if merge confli...")
Differential Revision: https://reviews.freebsd.org/D38896
rollback_files() tried to install files before creating the directories
for those files. In some cases this is due to special handling to
install certain classes of files earlier than others.
Just create all directories up front when performing rollback.
PR: 273950
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42020
Further to f6d37c9ca1 ("freebsd-update: handle file -> directory on
upgrade"), handle the reverse case of a directory changing to a file.
We may not encounter this case on upgradess (before freebsd-update is
retired) but it is needed to support rollback.
PR: 273950
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41945
If the directory is empty we fail with a message regarding mkdir in which
the empty directory can't be seen because it is not quoted.
Show a nice message so the user knows what is going on.
Reviewed by: bapt@
Differential Revision: https://reviews.freebsd.org/D42252
The current xo_format string is incorrect. This restores the display
format prior to libxo-ification work while also explicitly marking
tv_sec and tv_usec as encoded output only.
MFC after: 1 week
Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42269
vCPU threads are starting before init_snapshot() is called. That can lead
to corruption of vcpu_lock userspace mutex (snapshot.c) and then VM hangs
in acquiring that mutex.
init_snapshot() initializes only static variables (mutex, cv) and that
code can be optimized and removed.
Fixes: 9a9a248964 ("bhyve: init checkput before caph_enter")
Reviewed by: markj
MFC after: 1 week
Sponsored by: vStack
Which should avoid situation where flushed filesystem is not autofs,
because it was mounted over autofs mp.
Reported and tested by: Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
PR: 272446
Reviewed by: mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42023
Creating an IP socket to invoke the SIOCGIFFLAGS ioctl on is the only
thing preventing bhyve from working inside a bhyve jail with IPv4 and
IPv6 disabled restricting the jailed bhyve process to only access the
host network via a tap/vmnet device node.
PR: 273557
Fixes: 56be282bc9 ("bhyve: net_backends, automatically IFF_UP tap devices")
Reviewed by: markj
MFC after: 1 week
We're accessing one element of the newly allocated and the old directory
too much.
Reported by: andy@omniosce.org
Reviewed by: markj
Fixes: 6f9ebb3d0f ("bhyve: add helper for adding fwcfg files")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42220
If a request ends up growing beyong the initially allocated space the
netlink functions (such as snl_add_msg_attr_u32()) will allocate a
new buffer. This invalidates the header pointer we can have received
from snl_create_msg_request(). Always use the hdr returned by
snl_finalize_msg().
Reviewed by: melifaro
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42223
When generating a message for a dialog box into a static buffer, use
snprintf instead of sprintf to avoid buffer overflows.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42240
Don't abuse the message[] static buffer used elsewhere for error
messages to generate the command that actually newfs's each
filesystem. Use asprintf to a more aptly-named 'char *command'
variable to construct the string instead. This avoids potential bugs
from truncation of the command string.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42239
This avoids potential bugs with the length passed to malloc not
matching the string written via sprintf.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42238
Allocate the buffer holding the newfs command string dynamically
(building the string via open_memstream) rather than storing the
command into a caller-supplied buffer of unknown length.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42237
EPRINTLN handles newlines appropriately when stdout/stderr have been
reused as the backend for a serial port.
For bhyverun.c itself, the rule this attempts to follow is to use
regular fprintf/perror/warn/err prior to init_pci() (which is when
serial ports are configured) and to switch to EPRINTLN afterwards.
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D42182
I got a check inverted in a previous cleanup commit and as a result
partedit was only applying GEOM changes (and generating an /etc/fstab)
if it got an error reading the current GEOM mesh. Instead, it needed
to do those actions if it succeeded in reading the mesh.
The lack of /etc/fstab meant that bsdinstall mount didn't mount
anything in a scripted install.
PR: 273723
Reported by: Andrey Fesenko <andrey@bsdnir.info>
Reported by: Michal Nowak <mnowak@startmail.com>
Reviewed by: cognet, brooks
Fixes: 2309909919 bsdinstall: Handle errors from geom_gettree.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42236
Console and tty descriptors are initially opened in parse_action() to
determine whether they are valid using isatty(). That descriptor is then
closed because it is never accessed by syslogd again; ttymsg() will reopen
the tty/console under a new descriptor when needed.
If the user attempts to log to a tty that is inactive outside of
syslogd, then syslogd must keep that descriptor open so the tty remains
accessible. For example, logging to `/dev/ttyvb` requires the initial
`/dev/ttyvb` descriptor to stay open so the user can view its buffer at
any time via CTRL+ALT+F12.
As a result, console and tty descriptors must remain open until a
potential configuration reload or a system shutdown. The given
descriptor will be closed in close_filed() in such circumstances.
PR: 274454
Fixes: c3175a6e1c ("syslogd: Do not open console descriptor")
Reported by: Trond Endrestøl <Trond.Endrestol@ximalas.info>
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D42215
Restore UI behavior like previous disk menu implementation built on
dialog(3):
* Buttons of Create and Modify forms always active to close the
dialogs just pressing Enter.
* Disk menu indentation.
This should be less confusing for new users.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42213
- Collapse IDENT_SEND/IDENT_WAIT states down to a single state.
- Remove unused 'len' argument to op_data callback. The value passed
in (total amount of remaining data to receive) didn't seem very useful
and no op_data implementations used it.
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D41286