Commit graph

2682 commits

Author SHA1 Message Date
Edward Tomasz Napierala
c0163f4abe rc: make ctld depend on NETWORKING
This fixes a problem where ctld(8) would refuse to start on boot
with a specific IP address to listen on configured in ctl.conf(5).
It also fixes a problem where ctld(8) would fail to start with
some network interfaces which require a sysctl.conf(5) tweak
to configure them, eg to switch them from InfiniBand to IP mode.

PR:		232397

(cherry picked from commit 015351de04)
2022-01-21 09:45:20 +02:00
Emmanuel Vadot
3c49f0f9af Fix gssd rc.d installation
CONFGROUPS needs to be in CAPS

Fixes: a30235a4c3 ("pkgbase: Create a FreeBSD-kerberos package")
Reported by:	    kp

(cherry picked from commit 860ee1792a)
2022-01-14 14:43:40 +01:00
Emmanuel Vadot
12f4976f48 pkgbase: Create a FreeBSD-ftpd package
And put ftpd into it.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33453

(cherry picked from commit 20cd6e315e)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
d9a4b7b7bd pkgbase: Create a FreeBSD-tcpd package
And put the tcp-wrapper utilities in it.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33439

(cherry picked from commit 078b764da3)
2022-01-05 18:23:52 +01:00
Emmanuel Vadot
b2d245a0b0 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435

(cherry picked from commit 93c4369096)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
26c7445164 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
d71c2dfc78 pkgbase: Create a FreeBSD-hyperv package
Put all hyperv utilities in it.

Differential Revision:	 https://reviews.freebsd.org/D31805

(cherry picked from commit db953e8b97)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
f5ab36c2e1 pkgbase: Create a FreeBSD-kerberos package
This allows users to install or not kerberos related utilities
and libs.

Differential Revision:	https://reviews.freebsd.org/D31801

(cherry picked from commit a30235a4c3)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
872aa9c8a6 pkgbase: Create a FreeBSD-telnet package
both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31791
Reviewed by: emaste

(cherry picked from commit c7fd29f0f2)
2022-01-05 18:23:49 +01:00
Konstantin Belousov
1a28d9343c rtld: load preloaded vdso
(cherry picked from commit c210ef1347)
2022-01-02 18:43:01 +02:00
Konstantin Belousov
d00ebd9b9c Pass vdso address to userspace
(cherry picked from commit 01c77a436e)
2022-01-02 18:43:01 +02:00
Bjoern A. Zeeb
1a30549073 rc: network.subr improve network6_getladdr()
In network6_getladdr() we are iterating over inet6 lines and are not
interested in any others.  So tell ifconfig to limit output to "inet6"
as much as possible.
This is probably a micro-optimisation but was noticed while looking
at other IPv6-related boot-time improvements.

(cherry picked from commit e448ff6f0e)
2021-12-29 16:01:46 +00:00
Cy Schubert
704945b0e0 hostapd: Fix wlan interfaces not UP/RUNNING
Like wpa_supplicant, hostapd does not automatically UP the interface
when configured. The fix is similar to 5fcdc19a81.

Reported by:	avg
Tested by:	avg

(cherry picked from commit 0da2c91e64)
2021-12-21 15:34:39 -08:00
Konstantin Belousov
ba839bc9d3 rtld: extract header validation into new helper check_elf_headers()
(cherry picked from commit 63fc4e820c)
2021-12-13 02:58:22 +02:00
Ed Maste
bf4a70bb40 libc: Use musl's optimized strchr and strchrnul
Parentheses added to HASZERO macro to avoid a GCC warning, and formatted
with clang-format as we have adopted these and don't consider them
'contrib' code.

Obtained from:	musl (snapshot at commit 4d0a82170a25)
Reviewed by:	kib (libc integration), mjg (both earlier)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17630

(cherry picked from commit 7f72497ef7)
2021-12-12 17:32:33 -05:00
Colin Percival
8056b73ea1 etc/defaults/rc.conf: Add -i flag to rtsol/rtsold
This disables the random (between zero and one seconds) delay before
rtsol and rtsold send a a Router Solicitation packet.  This delay is
specified as a SHOULD by RFC 4861 for avoidance of network congestion,
but network speeds have increased enough in the 25 years since this
first appeared (in RFC 1970) that it seems unnecessary as a default
at this point.

This speeds up the FreeBSD boot process by an average of 500 ms.

Reviewed by:	kp
Relnotes:	yes
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D33089

(cherry picked from commit e29711da23)
2021-12-05 10:27:37 -08:00
Mateusz Piotrowski
c88c1274ca rc: Hook zfskeys to the build
Reviewed by:	allanjude
Approved by:	allanjude (src)
MFC after:	3 days
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D33230

(cherry picked from commit bfb7a31b6a)
2021-12-05 18:07:41 +01:00
Mateusz Piotrowski
c180637708 os-release: Quote variables as documented in the manual
Variables must be quoted if they contain non-alphanumeric characters.

Warner noted in the review that the lack of quoting causing problems
here is rather an edge case. I believe that it's worth adding the quotes
here anyway because this is what the specification says and there is no
good reason not to follow it.

Reviewed by:	imp
Approved by:	imp (src)
MFC after:	7 days

(cherry picked from commit 169e06fa78)
2021-12-05 17:44:09 +01:00
Rick Macklem
2cd26a286a nfsd: Add a new rc variable nfs_server_maxio
Since vfs.nfsd.srvmaxio can only be set when nfsd.ko
is loaded, but nfsd is not running, setting it in
/etc/sysctl.conf is not feasible when "options NFSD"
was not specified for the kernel.

This patch adds a new rc variable nfs_server_maxio,
which sets vfs.nfsd.srvmaxio at the correct time.

rc.conf.5 will be patched separately.

(cherry picked from commit 5509bad74e)
2021-12-01 14:01:57 -08:00
Konstantin Belousov
a95dbfaa3d rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally
(cherry picked from commit f340188625)
2021-12-01 03:07:19 +02:00
Eugene Grosbein
f085bb0e62 rc.d/rctl: unbreak for distinct /usr filesystem
Both rctl and used xargs utility live in /usr/bin
so add REQUIRE: FILESYSTEMS

Reported by:	Peter <pmc@citylink.dinoex.sub.org>

(cherry picked from commit 0c54fe172a)
2021-11-23 15:29:41 +07:00
Konstantin Belousov
b26ac07d6c rtld dump_auxv: be pedantic and distiguish between auxv union members based on format
(cherry picked from commit b61bce17f3)
2021-11-19 06:25:27 +02:00
Konstantin Belousov
f363b08c6d rtld dump_auxv: consistently use long modifier for non-pointer auxv vals
(cherry picked from commit 3a902ef253)
2021-11-19 06:25:27 +02:00
Konstantin Belousov
8ade0046f6 rtld: Implement LD_SHOW_AUXV
(cherry picked from commit 64ba1f4cf3)
2021-11-19 06:25:27 +02:00
Konstantin Belousov
ec3bd288b6 rtld: add rtld_fdprintfx()
(cherry picked from commit 77c088ab21)
2021-11-19 06:25:27 +02:00
Konstantin Belousov
7647baa1e8 rtld: style adjustments
(cherry picked from commit 74aec9618f)
2021-11-10 21:36:20 +02:00
Konstantin Belousov
1d6fd007eb rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag
(cherry picked from commit c5637b8be8)
2021-11-10 21:36:20 +02:00
Konstantin Belousov
514a095250 rtld: fix dangerous_ld_env calculation for ld_dynamic_weak
(cherry picked from commit 8363963a8f)
2021-11-09 06:49:26 +02:00
Emmanuel Vadot
b6b9176030 rtld: Do not install libmap.conf when installing the COMPAT32 version
This has the effect of installing the same file twice at the same location
and confuse pkgbase as we add this file twice in the package config part.

MFC after:  1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit d0f0e0bd74)
2021-11-06 16:03:06 +01:00
Cy Schubert
33b73d010d wpa: Address CTRL-EVENT-SCAN-FAILED
5fcdc19a81 didn't fully resolve the issue. There remains a report
that an ifconfig wlan0 up by itself is insufficient. Ifconfig down
must precede it.

Reported by:	Filipe da Silva Santos <contact _ shiori_com_br>
Fixes:		5fcdc19a81

(cherry picked from commit d06d7eb091)
2021-11-04 11:30:25 -07:00
Cy Schubert
f9d2cbc6a5 wpa: Address CTRL-EVENT-SCAN-FAILED
Some installations may experience CTRL-EVENT-SCAN-FAILED when
associating to an AP. Installations that specify
ifconfig_wlan0="WPA ... up" in rc.conf do not experience
the problem whereas those which specify ifconfig_wlan0="WPA" without
the "up" will experience CTRL-EVENT-SCAN_FAILED.

However those that specify "up" in ifconfig_wlan0 will be able to
reproduce this problem by service netif stop wlan0;
service netif start wlan0. Interestingly The service netif stop/start
problem is reproducible on the older wpa 2.9 as well.

Reported by:	dhw
Reported by:	"Oleg V. Nauman" <oleg _ theweb_org_ua>
Reported by:	Filipe da Silva Santos <contact _ shiori_com_br>
Reported by:	Jakob Alvermark <jakob _ alvermark_net>

(cherry picked from commit 5fcdc19a81)
2021-11-04 11:30:25 -07:00
Konstantin Belousov
57dc5bdc12 rtld: Print currently configured search path for libraries for -v
(cherry picked from commit 40ddde6ef9)
2021-10-28 03:35:53 +03:00
Konstantin Belousov
a3876ab1eb rtld-elf/paths.h: Make it usable outside rtld
(cherry picked from commit 33dba3bb0e)
2021-10-23 02:32:27 +03:00
Fangrui Song
c99fa2c634 rtld: Support DT_RELR relative relocation format
(cherry picked from commit a7d137fcbc)
2021-10-23 02:32:27 +03:00
Konstantin Belousov
00df149452 crt_malloc: more accurate handling of mmap(2) failure
PR:	259076

(cherry picked from commit 73dddffc31)
2021-10-23 02:32:27 +03:00
Konstantin Belousov
e5a8b8152a crt_malloc: Be more persistent when handling mmap() failure
PR:	259076

(cherry picked from commit 19e008e7f7)
2021-10-23 02:32:27 +03:00
Konstantin Belousov
cf12f7ba97 crt_malloc: use uintptr_t instead of long for arithmetic on addresses
(cherry picked from commit 0b72d2965d)
2021-10-23 02:32:27 +03:00
Konstantin Belousov
5aebce3790 rtld direct exec: add -d option
(cherry picked from commit ba7f9c1b61)
2021-10-20 03:42:25 +03:00
Tom Hukins
0cd2f8f6ab Remove obsolete amd(8) rc.conf configuration
The script that used these was removed in 13f7dbe822 along with amd
itself.

Fixes:		13f7dbe822 ("retire amd(8)")
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/548

(cherry picked from commit 70ffa69e1b)
2021-10-11 20:38:06 -04:00
Kyle Evans
d330c24cc0 bootp: remove the USE_BFUNCS knob
We'd likely be better served by converting these to the equivalent mem*
calls, but just kill the knob for now. The b* macros being defined get
in the way of _FORTIFY_SOURCE.

(cherry picked from commit cfb9be5062)
2021-10-06 02:14:39 -05:00
Dan Langille
606d2063db Enable rc.d/jail within jails
Jails with jails is a supported. This change allows the script to run
upon startup with a jail. Without this, jails are not automatically
started within jails.

(cherry picked from commit 35cf9fecbd)
2021-08-29 09:37:13 +02:00
Konstantin Belousov
2c0233d2a0 rtld: constify most variables holding references to the environment values
(cherry picked from commit aa68b3bb2e)
2021-08-23 12:20:56 +03:00
Konstantin Belousov
2b5ccf507a rtld: provide private getenv(3)
(cherry picked from commit b4b2748891)
2021-08-23 12:20:56 +03:00
Konstantin Belousov
f2f2f23ad7 rtld: avoid use of of getenv(3) for evaluating rtld env vars (LD_XXX)
(cherry picked from commit bfd4c875a1)
2021-08-23 12:20:56 +03:00
Konstantin Belousov
2395d5ddbf rtld: rework how environment variables are named
(cherry picked from commit 451dc2b7cc)
2021-08-23 12:20:56 +03:00
Fangrui Song
edb509a026 rtld: Switch to the standard symbol lookup behavior if LD_DYNAMIC_WEAK is set
(cherry picked from commit 7da378f9de)
2021-08-23 12:20:56 +03:00
Fangrui Song
2aa761055c rtld: Remove calculate_tls_end
(cherry picked from commit 8f63fa78e8)
2021-08-23 12:20:56 +03:00
Fangrui Song
a3c0eaa3c2 rtld: Fix i386/amd64 TP offset when p_vaddr % p_align != 0
(cherry picked from commit e6c7696203)
2021-08-23 12:20:56 +03:00
Alan Somers
2e6862b12b ftpd: delete dead code
Delete code killed by SVN r13139 in 1996.  Little chance that it would
still compile today.

PR:		257317
Reported by:	Alan Shearer <sakison@gmail.com>
Sponsored by:	Axcient

(cherry picked from commit 674400eb20)
2021-08-22 21:25:29 +00:00
Eirik Øverby
e81b2348d2 Add zfskeys rc.d script for auto-loading encryption keys
ZFS in 13 supports encryption, but for the use case where keys are
available in plaintext on disk there is no mechanism for automatically
loading keys on startup.

This script will, by default, look for any dataset with encryption and
keylocation prefixed with file://. It will attempt to unlock, timing
out after 10 seconds for each dataset found.
User can optionally specify explicitly which datasets to attempt to
unlock.

Also supports (optionally by force) unmounting filesystems and unloading
associated keys.

Sponsored by:	Modirum
Differential Revision:	https://reviews.freebsd.org/D30015

(cherry picked from commit 33ff39796f)
2021-08-22 14:53:21 +00:00