Commit Graph

2944 Commits

Author SHA1 Message Date
Konstantin Belousov
a7bca69492 rtld_tls.h: style
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-06-05 22:33:17 +03:00
Andrew Gallatin
fd96685a4a Revert "When stopping powerd, set the CPU frequency back to its maximum value"
This reverts commit 1dcb6ad173.

As of "8cb16fdbea6b Restore original frequency on exit.", powerd
restores the original frequency itself.

Further, if the original frequency is not the same as the
first frequency found in the frequency list, then the restoration
done by the powerd_poststop will restore the wrong frequency.
This can happen on Intel machines where Turbo is not enabled,
but the turbo frequency is first in the list of frequencies.
In this case, turbo will be enabled when the user did not want
it to be.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40197
Reviewed by: imp, mav
2023-05-25 09:40:26 -04:00
Christos Margiolis
7900879eec rc.resume: remove obsolete comment
Reviewed by:	markj
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D40235
2023-05-23 18:26:56 +03:00
Johannes Totz
2cf8ef5910 rc.suspend: execute rc-scripts with suspend keyword
For symmetry with rc.resume, give rc.suspend the ability to execute
rc-scripts. Use the suspend keyword for that.

Use-case is for setting a wake-up time, e.g. via efiwake.

Reviewed by:	christos
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D39965
2023-05-23 18:11:31 +03:00
Xin LI
634a770a5e /etc/rc.d/motd: Update to accommodate changes in uname(1) and newvers.sh
The recent changes to the uname(1) command removed trailing spaces for
better POSIX conformance, but it broke the regular expression used by
the motd script which expected it.  This commit addresses this by removing
the requirement, as it is no longer present.

Additionally, a recent change in newvers.sh introduced a new format for
uname -v, which omited the build number and build dates to improve
reproducible build support.  This commit adds support for this new format.

Reported-by:	Jamie Landeg-Jones <jamie@catflap.org>
Reviewed-by:	imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40225
2023-05-22 22:05:35 -07:00
Colin Percival
dc5361ea16 rc.d/netif: Don't DAD if lo0 is the only IPv6 IF
The code in rc.d/netif waiting for IPv6 Duplicate Address Detection if
any network interfaces support IPv6.  Unfortunately, since lo0 *always*
has IPv6 enabled, this means unconditionally sleeping, even on systems
which have no external IPv6 interfaces.

Since we presume that there is little risk of a duplicate address being
assigned on lo0, amend the test to wait only if there is an interface
*other than lo0* which supports IPv6.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D40141
2023-05-18 08:20:15 -07:00
Peter Wright
d904b43ba3 dma: install a simple example for the auth.conf file
PR:		270088
MFC After:	3 days
2023-05-15 09:20:14 +02:00
Enji Cooper
46f35bf28d rc.subr(8): delete debug cpuset helper
Summary:
The intention of the original author (I assume) was to add this logic
for testing. This removes the debug statement so it no longer shows up
in calls to `status`.

MFC after:	2 weeks
MFC with:	0661f9389

Reviewers: kevans

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D40055
2023-05-12 19:50:00 -07:00
Warner Losh
b61a573019 spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:04 -06:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Pierre Pronchery
bdf6dee2a9 dma: specify OpenSSL 1.1 API
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-05-11 19:03:34 -04:00
Enji Cooper
4e9041a786 rc.subr(8): run trailing-whitespace-fixer
This change deletes benign trailing whitespace from rc.subr, making
future non-stylistic changes easier to spot.

MFC after:	1 week
2023-05-10 22:39:32 -07:00
Miroslav Lachman
0661f93892 rc: add support for cpuset(1)
If ${name}_cpuset is specified (and /usr is mounted), cpuset(1) will be
run to limit the service to the configured cpuset.

PR:		142434
Reviewed by:	kevans
2023-05-10 23:40:18 -05:00
Ed Maste
ec1e83782d rtld: don't add extraneous -L directory when MK_TOOLCHAIN == no
rtld's Makefile used to add -L${LIBDIR} to LDFLAGS when MK_TOOLCHAIN was
no.  This was done as part of a change to fix building rtld with
MK_TOOLCHAIN == no (although I'm not sure this part was necessary).

In any case as of 5f2e84015d libc_pic.a is built independent of the
MK_TOOLCHAIN setting and the main part of the workaround has already
been removed.  Remove the rest now.

This reverts commit c0f5aeb032.

Reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39938
2023-05-02 18:01:43 -04:00
Warner Losh
0c4183f02e rc.d/zfsbe: Simplify
So $(foo) is a shorter version of "`foo`".

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39413
2023-05-01 15:02:53 -06:00
Colin Percival
df53ae0fdd Remove portsnap(8)
Rather than having a tool in the FreeBSD base system for obtaining
the FreeBSD ports tree, users are encouraged to `pkg install git`
and then `git clone https://git.FreeBSD.org/ports.git /usr/ports`.

The portsnap servers will continue operating until FreeBSD 13 reaches
its End-of-Life, and portsnap is available from the ports tree as
ports-mgmt/portsnap.

Requested by:	portmgr
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39563
X-MFC:		no
2023-04-22 18:12:37 -07:00
Bjoern A. Zeeb
de1dde5dfe network.subr: adjust regex for wlans_xxxxx rc.conf entries
Drivers like ath1[012]k will not match the current wlans_*-regex as
they have digits followed by letters.  Adjust the regex to allow
this combination in order to be able to configure interfaces with
names like wlans_ath11k0="..."

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D39674
2023-04-20 14:30:42 +00:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
John Baldwin
eae7dd0f22 rbootd: Remove an unnecessary (and incomplete) function prototype.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39522
2023-04-18 11:22:08 -07:00
John Baldwin
e4253ae822 rpc.rstatd/rwalld: Use more accurate function pointer types.
Reviewed by:	zlei, rmacklem
Differential Revision:	https://reviews.freebsd.org/D39521
2023-04-18 11:21:50 -07:00
John Baldwin
8b356c8881 bootpd: Use C89 function definitions.
Trim a few duplicate (but incomplete) function prototypes as well.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39520
2023-04-18 11:21:15 -07:00
John Baldwin
525438ea71 sendmail: Silence -Wdeprecated-non-prototype warnings.
These will hopefully be fixed upstream eventually, but silence the
warnings until then.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39518
2023-04-18 11:19:48 -07:00
Konstantin Belousov
7cdfe51f30 rtld: fixes for handling of the grouped options
Do not terminate scanning group when 'd' is encountered.
The 'b' option must be last in the group, same as 'f'.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39544
2023-04-13 17:37:33 +03:00
Ed Maste
29e3a06510 rtld: fix SysV hash function overflow
Quoting from https://maskray.me/blog/2023-04-12-elf-hash-function:

The System V Application Binary Interface (generic ABI) specifies the
ELF object file format. When producing an output executable or shared
object needing a dynamic symbol table (.dynsym), a linker generates a
.hash section with type SHT_HASH to hold a symbol hash table. A DT_HASH
tag is produced to hold the address of .hash.

The function is supposed to return a value no larger than 0x0fffffff.
Unfortunately, there is a bug. When unsigned long consists of more than
32 bits, the return value may be larger than UINT32_MAX. For instance,
elf_hash((const unsigned char *)"\xff\x0f\x0f\x0f\x0f\x0f\x12") returns
0x100000002, which is clearly unintended, as the function should behave
the same way regardless of whether long represents a 32-bit integer or
a 64-bit integer.

Reviewed by:	kib, Fangrui Song
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39517
2023-04-12 12:44:34 -04:00
Ed Maste
87443cb6c6 rtld: reindent and style(9) elf_hash()
In preparation for an upcoming change (D39517).

Sponsored by:	The FreeBSD Foundation
2023-04-12 12:43:36 -04:00
John Baldwin
7d8e1e8dd9 libcasper: Move helper libraries from /lib/casper to /lib.
These libraries are linked to directly by applications rather than
opened at runtime via dlopen().

Discussed with:	oshogbo
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39245
2023-03-29 15:04:28 -07:00
John Baldwin
3ba927fdc4 rc.d/ldconfig: Remove mips64 check for ldconfig32. 2023-03-29 10:20:03 -07:00
Cy Schubert
052211e08c rc: Chase bfb202c455 and remove ifconfig down/up for wpa_supplicant
bfb202c455 addresses the CTRL-EVENT-SCAN-FAILED. Upstream d807e289d
caused FreeBSD regression in driver_bsd.c, which this rc.d patch
worked around. As of bfb202c455 this workaround is no longer needed.

Reviewed by:	bz (for wireless)
MFC after:	10 days
X-MFC with:	bfb202c455
Differential Revision:	https://reviews.freebsd.org/D39257
2023-03-24 10:07:29 -07:00
Mina Galić
3693d9140e rc: ignore .pkgsave files
The local parts of rc already skip .sample files; we add .pkgsave to the
list, and add logic for base.

Thanks to @RhodiumToad for getting this started.

Differential Revision: https://reviews.freebsd.org/D27962
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/662
2023-03-14 20:52:15 -06:00
Rick Macklem
0bb08f21cc rc.d: Fix NFS server startup scripts to enable vnet prison use
Now that commit cbbb22031f is in main,
it is possible to run nfsd(8), nfsuserd(8), mountd(8),
gssd(8) and rpc.tlsservd(8) in an appropriately configured vnet
prison if the "allow.nfsd" option is specified in jail.conf.

This patch fixes the rc scripts for this.
Mostly just replaces the "nojail" KEYWORD with "nojailvnet",
but also avoids setting vfs.nfsd.srvmaxio in a prison, since it
must be set outside of the prisons and applies to all
nfsd(8) instances.

Reviewed by:	jamie
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D38809
2023-03-12 14:34:25 -07:00
Dag-Erling Smørgrav
1955ad42b3 tftpd: Gracefully skip tests if networking is not enabled.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39012
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
77e83935b7 tftpd: Don't forget to close stderr on startup.
Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd.  We need to close it so inetd can process further requests, be restarted, etc.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38968
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
b4736c90ad tftpd: Don't consume arbitrary requests when failing to fork.
We've already consumed one request, which is sufficient to prevent inetd from endlessly restarting us in this particular and extremely unlikely case.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38967
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
e3b4cb1b32 tftpd: Use poll() instead of alarm() + setjmp().
While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38966
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
9f6f64941c tftpd: Make the -d option behave as documented.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38965
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
36242fc0e5 tftpd: Make the transfer functions return success / failure.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38957
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
7c21545c46 tftpd: Ensure that tftp_log() preserves errno.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38956
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
a6dfd2015c tftpd: Fix max block size calculation.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38953
2023-03-10 13:25:15 +00:00
Ceri Davies
efa3c0af37 rc.conf: update comment referring to /etc/motd 2023-03-09 21:28:30 +00:00
Tijl Coosemans
ecad3f5c4d rc.d: Generate machine-id from hostid_save
rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by:	delphij
Discussed with:	bapt
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38811
2023-03-09 10:31:55 +01:00
Tijl Coosemans
862aab6281 hostid: Generate random UUID by default
This way MAC addresses are no longer exposed.

Discussed with:	bapt
MFC after:	3 days
2023-03-09 10:31:39 +01:00
Baptiste Daroussin
a28ccb32bf machine-id: generate a compact version of the uuid
dbus and other actually expect an uuid without hyphens

Reported by:	tijl
MFC After:	3 days
2023-03-01 19:16:25 +01:00
Tom Hukins
0f994a19e2 rc.conf(5): describe what unbound(8) does
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/650
2023-02-28 09:36:17 -07:00
Mike Karels
eef9f9900f growfs_fstab startup script: set dumpdev to AUTO
The growfs_fstab script has been testing dumpdev, and if it is AUTO,
enables dumps on the newly-added swap device for the initial boot.
However, dumpdev defaults to AUTO on main, but NO on stable/13 and
release branches.  On the other hand, bsdinstall adds dumpdev="AUTO"
by default (controlled by a menu item).  bsdinstall is not used when
booting an SD card or other disk image.  Adopt the default from
bsdinstall, and set dumpdev to AUTO in /etc/rc.conf in the
growfs_fstab script if a swap partition has been added, along with
the explanatory comment added by bsdinstall.

Differential Revision:	https://reviews.freebsd.org/D38751
2023-02-28 07:55:35 -06:00
Konstantin Belousov
5942b4b6fd sys/param.h: Add _WANT_P_OSREL
Use it instead of defining IN_RTLD by base sources that want P_OSREL_
defines in userspace, but are not rtld.
This allows to remove abuse of IN_RTLD from userspace.

Reviewed by:	dchagin, markj, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38585
2023-02-15 02:43:18 +02:00
Xin LI
39e8c2a29a cleanvar: Be more careful when cleaning up /var.
The cleanvar script uses find -delete to remove stale files under /var,
which could lead to unwanted removal of files in some unusual scenarios.
For example, when a mounted fdescfs(5) is present under /var/run/samba/fd,
find(1) could descend into a directory that is out of /var/run and remove
files that should not be removed.

To mitigate this, modify the script to use find -x, which restricts the
find scope to one file system only instead of descending into mounted
file systems.

PR:		269213
MFC after:	1 week
2023-02-12 20:56:17 -08:00
Emmanuel Vadot
3662862f55 rc: syscons: Add UEFI special case
Changing cursor, screenmap and setting blanktime doesn't work when booted
with vt(4) and UEFI so add a special case for those depending on machdep.bootmethods.
I have no way to test if this can work with vt(4) and bios boot so just in case
keep calling those for this.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38293
2023-02-08 08:53:20 +01:00
Emmanuel Vadot
eac920e670 utx: Allow disabling user accounting
Make it possible to not run utx at boot.
Default to yes so this is a no-op for everyone.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38292
2023-02-08 08:52:54 +01:00
Emmanuel Vadot
cab549c76c pkgbase: Create a FreeBSD-console-tools package
And put in it:
 - kbdcontrol
 - vidcontrol
 - moused
 - kbdmap

Those aren't useful in a jail or for a modern desktop.
While here, split the devd.conf part into some new files.

Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38321
2023-02-08 08:52:40 +01:00
Warner Losh
f051d72314 hyperv: Build and install where supported
Remove the hard-coded dependency on HYPERV being only x86. Instead, 100%
rely on MK_HYPERV. It's always right (since it's marked BROKEN (so set
to "no") on architectures we don't support).

Sponsored by:		Netflix
Reviewed by:		bz
Differential Revision:	https://reviews.freebsd.org/D38306
2023-02-01 10:21:57 -07:00
Emmanuel Vadot
cc9b2b58e2 Revert "rc.d: Put growfs script in FreeBSD-ufs"
The growfs script also support zfs.

This reverts commit 36a7fa1e16.

Reported by:	emaste, Mina Galić
2023-01-27 11:30:24 +01:00
Emmanuel Vadot
a6a21bbedc rc.d: Put resolv script in FreeBSD-resolvconf
Differential Revision:	https://reviews.freebsd.org/D37190
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
36a7fa1e16 rc.d: Put growfs script in FreeBSD-ufs
Differential Revision:	https://reviews.freebsd.org/D37189
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
91314ca2ff rc.d: Put ggated script in FreeBSD-ggate
Differential Revision:	https://reviews.freebsd.org/D37188
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
81b18bea09 rc.d: Put dhclient script in FreeBSD-dhclient
Differential Revision:	https://reviews.freebsd.org/D37187
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
d8799160c2 rc.d: Put devmatch script in FreeBSD-devmatch
Differential Revision:	https://reviews.freebsd.org/D37192
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
f043569692 rc.d: Put devd script in FreeBSD-devd package
Differential Revision:	https://reviews.freebsd.org/D37186
2023-01-27 10:35:32 +01:00
Gordon Bergling
30985d19b0 rc.initdiskless: Fix a typo in a comment
- s/attemping/attempting/

MFC after:5 days
2023-01-19 14:17:37 +01:00
Ed Maste
45396fda8b dma: dma.conf.5 as MLINK to dma.8
There's no separate man page for dma.conf, but the format is documented
in dma.8.

Reviewed by:	bapt
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37944
2023-01-06 09:40:45 -05:00
John Baldwin
b069d3e019 rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"
After the removal of ia64 and sparc64, all current architectures
support executable stacks at an architectural level.

This reverts commit 1290d38ac5.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37904
2023-01-04 14:55:00 -08:00
Mike Karels
0e2fdab227 growfs script: fix config-dependent errors
- awk sometimes formatted swapbase as floating point, which gpart
  does not accept; force int.

- Fix typo in code for checking vm.max_swap_pages.

- While here, do not set kernel env if "gpart add" fails.

- Add "gpart show" before modification to verbose output.

Reported by:	marklmi at yahoo dot com
Tested by:	marklmi at yahoo dot com
2023-01-04 14:05:35 -06:00
Cy Schubert
e3e57edf4a network.subr: Fix infinite loop
When setting up carp tunnel, using a password consisting of only the
characters used as hexadecimal characters, i.e. abc-def, there will be
an infinite loop in the shell function ifalias_af_common_handler().
To circumvent this we test for " pass ".

PR:		268378
Reported by:	jyoung15@gmail.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37748
2023-01-02 10:20:05 -08:00
Cy Schubert
87061d3bff network.subr: Add missing brace
PR:		268378
Submitted by:	jyoung15@gmail.com
Reported by:	jyoung15@gmail.com
MFC after:	3 days
2023-01-02 10:20:05 -08:00
Cy Schubert
fef0e429f1 network.subr: Replace "\ " with "[[:space:]]"
"[[:space:]]" is easier to read than "\ " and is conisitent with
clone_up().

Reported by:	eugen
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D37748
2023-01-02 10:20:05 -08:00
David E. O'Brien
96c6fba6fd rc.subr: Minor formatting fix for ac102a2a6 2022-12-28 16:00:56 -08:00
Jose Luis Duran
058ac3e806 atf_pytest_wrapper: fix pytest output truncation
Pass `-vv` to pytest in order to always get the full output.
While here, enforce the modeline.

Differential Revision: https://reviews.freebsd.org/D37894
MFC after:	2 weeks
2022-12-28 17:31:14 +00:00
Mike Karels
4c8a257810 growfs script: fixes
Cannot use single quote in comment in awk script;
add growfs_fstab to Makefile

Fixes:		4a30d7bb373c,d670a8f7c596
2022-12-26 08:51:09 -06:00
Tobias C. Berner
62a149bf62 Add new rc: machine_id to generate /etc/machine-id
This new default-enabled rc will generate a /etc/machine-id file if it
does not exist, and pre-fill it with a newly generated UUID of version 4
[2].

The file is generated in /var/db/machine-id and symlinked to
/etc/machine-id to allow for read-only root partitions.

This file is amongst other things used by libraries like GLib.

Bump FreeBSD version 1400076 to be able to easily add support for older
version of FreeBSD via a package.

[1] Linux machine-id(5): https://www.man7.org/linux/man-pages/man5/machine-id.5.html
[2] f176fe8e7f

Approved by:		bapt
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D37722
2022-12-23 17:33:19 +01:00
Mike Karels
b939fe5ff1 dma mailer.conf: add comments, including pointer for sendmail
Add comments analogous to those that are in the sendmail mailer.conf,
including a pointer to /usr/share/examples/sendmail/mailer.conf.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D37711
2022-12-16 09:12:39 -06:00
Mike Karels
af01b47225 default rc.conf: Add new growfs_swap_size variable
Add new growfs_swap_size variable with a default value of the empty
string, along with comments on other settings.  Used by the growfs
script.

Differential Revision:	https://reviews.freebsd.org/D37464
2022-12-10 13:40:33 -06:00
Mike Karels
d670a8f7c5 growfs_fstab: add new /etc/rc.d script to add swap to fstab
The growfs_fstab script is a helper for the growfs script to add any
new swap partition to /etc/fstab on first boot.  If growfs adds a
swap partition, it sets growfs_swap_pdev in the kenv.   In this case,
after the root file system is read/write, if there is no swap partition
in the fstab, growfs_fstab adds growfs_swap as a swap partition to the
fstab.  Also, it runs dumpon to add the swap partition  (as this
happened earlier in the startup sequence).

Discussed with:	cperciva
Differential Revision:	https://reviews.freebsd.org/D37463
2022-12-10 13:39:59 -06:00
Mike Karels
4a30d7bb37 growfs script: add swap partition as well as growing root
Add the ability to create a swap partition in the course of growing
the root file system on first boot, enabling by default.  The default
rules are: add swap if the disk is at least 15 GB (decimal), and the
existing root is less than 40% of the disk.  The default size is 10%
of the disk, but is limited by the memory size.  The limit is twice
memory size up to 4 GB, 8 GB up to 8 GB memory, and memory size over
8 GB memory. Swap size is clamped at vm.swap_maxpages/2 as well.
The new swap partition is labeled as "growfs_swap".

The default behavior can be overridden by setting growfs_swap_size in
/etc/rc.conf or in the kernel environment, with kenv taking priority.
A value of 0 inhibits the addition of swap, an empty value specifies
the default, and other values indicate a swap size in bytes.

By default, addition of swap is inhibited if a swap partition is found
in the output of the sysctl kern.geom.conftxt before the current root
partition, usually meaning that there is another disk present.
Swap space is not added if one is already present in /etc/fstab.

The root partition is read-only when growfs runs, so /etc/fstab can
not be modified.  That step is handled by a new growfs_fstab script,
added in a separate commit.  Set the value "growfs_swap_pdev" in kenv
to indicate that this should be done, as well as for internal use.

There is optional verbose output meant for debugging; it can only be
enabled by modifying the script (in two places, for sh and awk).
This should be removed before release, after testing on -current.

Discussed with:	cperciva
Reviewed by:	imp (previous version)
Differential Revision:	https://reviews.freebsd.org/D37462
2022-12-10 13:38:36 -06:00
Baptiste Daroussin
d525abd277 dma(8): add newaliases to mailer.conf
Reported by:	karels
MFC After:	3 days
2022-12-06 08:31:23 +01:00
Baptiste Daroussin
9eb502a337 sendmail: revert to use use NONE
The NONE parameter has been deprecated for more than 20 years
but was never removed, its useful to simplify the sendmail
management.

This reverts commit 7cadc52638.
2022-12-05 17:23:08 +01:00
John Baldwin
42fb28cef4 Explicitly set CXXSTD to c++11 for old C++ code using std::auto_ptr<>.
GCC 12 defaults to C++17 which removes (not just deprecates)
std::auto_ptr<>.  Trying to use CXXSTD of c++03 doesn't work with
libc++ headers, but c++11 does.

Reviewed by:	brooks, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37531
2022-12-04 16:25:21 -08:00
Baptiste Daroussin
280f11f1be flua: chown(2) binding, fix bad copy/paste 2022-11-25 09:05:40 +01:00
Baptiste Daroussin
a1ab15abe2 flua: add a chown(2) binding
The main difference with the chown in luaposix, is that it checks
and reports if a user or a group do exist when a string is passed
as arguments

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D37479
2022-11-25 08:49:58 +01:00
John Baldwin
fd5882e1f2 tftpd: Disable -Wformat-nonliteral for GCC.
GCC warns about the non-literal format string passed to strftime().  A
warning here seems a bit odd as strftime() does not take varargs so
there is not a risk of missing args.
2022-11-22 11:12:06 -08:00
John Baldwin
8576f84bc1 tftp: Use printf0 attribute for options_set_request/reply.
These functions accept a NULL format argument so should use the printf0
attribute rather than plain printf.

Reported by:	GCC -Wformat
2022-11-22 08:37:26 -08:00
Goran Mekic
1ffc369aa3 Add dnctl rc.d service
As PF now also supports dummynet but can not configure it on its own,
the service which configures pipes, queues and schedulers is needed.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D37451
2022-11-22 10:46:19 +01:00
Dag-Erling Smørgrav
cf325fda86 tftpd: type nit
Sponsored by:	Klara, Inc.
2022-11-18 17:26:54 +01:00
Dag-Erling Smørgrav
b15e052e74 tftpd: Plug memory leaks in option handling code.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37423
2022-11-18 16:39:44 +01:00
Dag-Erling Smørgrav
bacb00ab40 tftpd: whitespace cleanup 2022-11-17 16:42:30 +00:00
Dag-Erling Smørgrav
eb0292d929 tftpd: cleanup
Sponsored by:	Klara, Inc.
2022-11-15 23:37:54 +01:00
Baptiste Daroussin
616f32ea6d othermta: remove leftover from 20 years ago
othermta (along with mta_start_script configuration entry in rc.conf)
was a mechanism used to be able to run another mta than sendmail(8) before
"rcng" time 20 years ago.

othermta has not been used since.
2022-11-14 09:08:37 +01:00
Konstantin Belousov
8cc44a1e59 rtld: add support for the $LIB token
similar to the same token in glibc.

Requested and reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37329
2022-11-11 12:06:30 +02:00
Baptiste Daroussin
0b1adc42a1 rc.sendmail: remove unused script
20 years ago the use of rc.sendmail script was dropped in favor
of /etc/rc.d/sendmail, it is time to retire the script entirely
now.

MFC after:	1 week
2022-11-09 16:55:18 +01:00
Jose Luis Duran
c7c9836853 sendmail: Add back a comment about "NONE"
Differential Revision:	https://reviews.freebsd.org/D37315
2022-11-09 16:54:34 +01:00
Baptiste Daroussin
7cadc52638 sendmail: do not use NONE
NONE is deprecated, instead of using NONE, switch to "NO" all
the sendmail_*_enable which sendmail_enable=NONE would have done
2022-11-09 15:20:30 +01:00
Baptiste Daroussin
b7104f1914 sendmail: document that sendmail_enable can be set to NONE
setting sendmail_enable to NONE (which is now the default)
turns all the sendmail_*_enable variables to NO

Reported by:	many
2022-11-08 14:39:27 +01:00
Baptiste Daroussin
a67b925ff3 mail: make The Dragonfly Mail Agent (dma) the default mta.
dma accepts mail from a local Mail User Agent (MUA) and delivers it
locally or to a smarthost for delivery. dma does not accept inbound
mail (i.e., it does not listen on port 25) and is not intended to
provide the same functionality as a full MTA like postfix or sendmail.
It is intended for use cases such as delivering cron(8) mail. which
is the default configuration and usage of sendmail in the default
setup of the base system.

In order to switch the default from sendmail to dma, we teach
mailwrapper to fallback on dma directly if the mailer.conf file cannot
be opened.
We install by default a mailer.conf file which points at dma
We install a mailer.conf file for sendmail in the examples.

Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D37035
2022-11-07 12:49:56 +01:00
Li-Wen Hsu
72a1cb05cd
rc(8): Add a zpoolupgrade rc.d script
If a zpool is created by makefs(8), its version is 5000, i.e., all
feature flags are off.  Introduce an rc script to run `zpool upgrade`
over the assigned zpools on the first boot.  This is useful to the
ZFS based VM images built from release(7).

Reviewed by:	imp, markj, mav
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37282
2022-11-07 11:30:09 +08:00
Dag-Erling Smørgrav
eb4d86d529 getty: Avoid NULL deref if stdin is not a tty.
Sponsored by:	Klara, Inc.
Obtained from:	Apple OSS Distributions
Differential Revision: https://reviews.freebsd.org/D37265
2022-11-04 15:54:01 +01:00
Dag-Erling Smørgrav
f285f41498 getty: code cleanup, part 2
* Clean up whitespace
* Reindent

Sponsored by:	Klara, Inc.
2022-11-04 15:22:04 +01:00
Dag-Erling Smørgrav
8ad7a14ab4 getty: code cleanup, part 1
* Avoid unnecessary use of `unsigned char *`
* Use explicit casts when assigning `unsigned char *` to `char *` or vice versa
* Drop unused global variables (and fix memory leak in `gettable()`)
* Use `snprintf()` instead of `strcpy()` + `strcat()`
* Drop spurious braces in switch

Sponsored by:	Klara, Inc.
Obtained from:	Apple OSS Distributions (in part)
Differential Revision: https://reviews.freebsd.org/D37263
2022-11-04 15:19:27 +01:00
Konstantin Belousov
f585d13dd6 rtld: remove unused macro FPTR_TARGET
It is a remnant from the ia64 removal

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-22 05:15:06 +03:00
Konstantin Belousov
ca2560bd85 rtld: fix typo in comment
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-10-17 17:10:03 +03:00
Dag-Erling Smørgrav
0aa2700123 Put OPIE to rest.
Differential Revision: https://reviews.freebsd.org/D36592
2022-10-02 03:37:29 +02:00
Brooks Davis
b4cfdbfed2 manpages: Remove telnetd references
Mostly remove from the SEE ALSO section, adding a mention of the port
where not removed. Elsewhere, remove as appropriate and change from .Xr
to .Nm where a mention of telnetd continues to make sense (or removing
it would require significant reworking of the surrounding text).

Reviewed by:	imp, delphij, emaste
Differential Revision:	https://reviews.freebsd.org/D36785
2022-09-29 17:56:41 +01:00
Brooks Davis
0eea46fb1f Remove telnetd
The telnetd codebase is unmaintained and has a number of quality
issues. Telnet has been largely supplanted by ssh. If needed, a port is
available (net/freebsd-telnetd), but a more maintained implementation
should be prefered.

While the telnet client suffers from the same issues, it is deemed
to be of lower risk and is required to connect to legacy devices, so
it remains.

Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D36620
2022-09-28 19:53:49 +01:00