sysutils/spiped: Clean up UNIX sockets
When a TCP socket is closed, it becomes possible to create a new
socket listening on the same address; the behaviour of UNIX (aka
"local") sockets is different, in that an inode remains even after
it is closed, and blocks the creation of a new socket with the same
address.
When spiped is launched with a UNIX socket as its source address,
delete any existing socket with that address first. This makes it
possible to "service spiped restart" when UNIX sockets are used.
Deleting the socket when stopping spiped would also work for the
case of restarting the daemon, but not for the case of starting the
daemon after an unclean system shutdown; so deleting only prior to
starting the daemon seemed like the better option.
PR: 295432
Reported by: feld
rtld: add spinlock around the crt malloc calls
Right now, the rtld malloc is called under the write-locked rtld bind
lock. A future change adds places where only read-locked rtld bind lock
is held, and then the spinlock protects the malloc structures from the
parallel updates.
Reviewed by: kevans
Tested by: Marek Zarychta <zarychtam at plan-b.pwste.edu.pl>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57908
rtld: stop using unbound alloca()
For DoneList allocations, its size depends on the number of loaded DSOs.
Small images could be served by alloca(), but large donelists need to
go into heap.
For map_object(), alloca size is the number of segments in the object.
In both cases, over-grown situations would cause a stack overflow.
PR: 295991
Noted and reviewed by: kevans
Tested by: Marek Zarychta <zarychtam at plan-b.pwste.edu.pl>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57908
net/py-lib389: Add new port
lib389 provides the Python library and command-line administration
tools for 389 Directory Server.
It includes tools for creating and managing Directory Server
instances, configuring servers, and managing directory entries.
This port is required for the development of net/freeipa-server.
WWW: https://www.port389.org/
Sponsored by: Netzkommune GmbH
net/389-ds-base: Fix instance creation
Add a dedicated dirsrv user and group.
Use FreeBSD-compatible paths for runtime files, databases, backups,
LDIF files, and logs. Create the persistent database and log parent
directories with suitable permissions.
Detect getpeereid(3) during configuration and fix peer credential
handling for LDAPI SASL EXTERNAL authentication.
Sponsored by: Netzkommune GmbH
netinet6: cleanse safeguards against IFT_PFLOG
This "interface" type is no more. Leave the constant in if_types.h, we
probably need an exp-run before removing it.
audio/aubio: fix build with python 3.12
The old waf build system relies on python module imp, which was removed
in python 3.12. This workaround is lifted directly from current waflib,
and allows aubio to build with recent python versions.
MAC/do: Add consistency tests
Test that:
1. Concurrent changes to different parameters on the same jail are
independent/atomic.
2. Inheritance works.
3. Relaxing only parent jail rules does not leak to a subjail thanks to
sequential consistency.
4. Sysctl knobs and jail parameters stay consistent.
Some of these tests may be extended in the future with several layers of
jails (there is only a single subjail currently).
Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
(cherry picked from commit 851499046d25fbe5841a55fb7bfcc879522f59a8)
MAC/do: Tests: Add support for exec paths, jail parameters, subjails
And also allow configuration of the mdo(1) executable path.
This commit only contains new or modified infrastructure. No functional
change intended at this point.
Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
(cherry picked from commit a95ff5ef7d1ffcb701913028253a4700cd9a1459)
mac_do.4: Document executable paths, default jail values and consistency
While here, fix the bug of mentioning 'enable' as a possible value for
the 'mac.do' jail parameter whereas it is 'new' instead.
Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
(cherry picked from commit 39818654ae879788807d3a87c2d75cc700cc7113)
MAC/do: Fix double-free on parse error after "executable paths" feature
parse_rules() has been calling toast_rules() in case of a parse error in
order to deallocate the 'struct rule' objects it has constructed up to
that point.
toast_rules() would take a pointer to a full 'struct rules' object, and
besides freeing all 'struct rule' referenced by it, would also free the
holding 'struct rules' itself.
With the introduction of the "executable paths" feature, and the
embedding of 'struct rules' into 'struct conf', meaning that the
lifecycle for 'struct rules' was no longer independent, toast_rules()
was changed not to free the passed 'struct rules' (as it was a field of
a 'struct conf' object). Unfortunately, this change was not completed
with a reinitialization of the rules list head, so the 'struct conf'
object would continue to reference just-freed rules, which then would be
freed a second time on destruction of that container.
[18 lines not shown]
MAC/do: Update copyright
Update years for the Foundation.
While here, remove the initial '/*-' which has been useless for a long
time.
While here, add a missing space on bapt@'s copyright line (approved by
him).
Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
(cherry picked from commit fcb0018634c77fe32ed99bca00f856af18ed240b)
MAC/do: Do not skip blanks when parsing executable paths
The kind of tolerance we apply to parsing rules, whose format we have
defined, cannot be applied to paths since blank characters are allowed
there.
There is still the limitation that no escape character is currently
supported, and so it is not possible to configure a path having a ':'
character.
Reviewed by: bapt
Fixes: 9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
(cherry picked from commit 1fa1e3f3950fc0593ab73ea075c24c9bfbe8afd6)
MAC/do: Serialize installing/modifying some jail's configuration
See the immediately preceding commit for explanations on what this is
fixing.
When setting 'mac.do' to 'inherit' on a jail with 'mac.do.rules' and
'mac.do.exec_paths' also specified in the same call, ensure that the
check that these passed parameters are the same as those to be inherited
is atomic with respect to enabling the inheritance (i.e., removing the
jail's 'struct conf' object). (See previous commit "MAC/do: Fix the
recent logic to set jail parameters, make it more tolerant" as for why
this check exists.)
Because we currently only modify a single configuration object per
transaction, we introduce the parse_and_commit_conf() wrapper around
parse_and_set_conf() to remove duplicated code that would ensue from
calling the latter directly, namely, releasing the 'mac_do_rwl' lock and
freeing the old configuration object (if any).
[11 lines not shown]