meson: Link basuctl with libbasu dynamically
This reduces the installed size significantly. I don't know about any
reason for bundling libbasu in basuctl when they both come from the
readme: reference mailing list and issue tracker
meson: Allow to build both shared and static library
See https://mesonbuild.com/Build-targets.html for more information.
readme: update IRC channel
freebsd: Do not use cr_pid from LOCAL_PEERCRED
LOCAL_PEERCRED is used as substitute for SO_PEERCRED on FreeBSD. One of
the fields needed from there is the PID of the peer process. However,
while SO_PEERCRED returns the PID at the time of connect(2),
LOCAL_PEERCRED returns the PID at the time of listen(2). If the dbus
daemon fork(2)'d after listen(2) to daemonize, then the PID returned
will no longer exist, which breaks basu.
Remove the use of cr_pid for now, as it cannot be used.
basic/socket-util: enable cr_pid on FreeBSD >= 12.3
test: switch to getprogname on FreeBSD
`program_invocation_short_name` is an alias for `__progname` in glibc.
FreeBSD also has `__progname` defined by startup code but (like `environ`)
it's not declared in any system header. Consumers are encouraged to
use `getprogname()` instead.
license: Remove GPL2 text
There are no GPL2 licensed files left in the repository at the time of
this commit, leaving the repo solely LGPL2.1+ licensed.
Delete the GPL2 license text as it no longer has any relevance.
ci: Mount linprocfs on FreeBSD
This allow the credential test to run correctly. This does not mean that
linprocfs is required for basu to work, just that this particular
functionality uses it.
bus-creds: Handle ESRCH from get_process_comm
FreeBSD's linprocfs does not have a comm file, so get_process_comm
returns ESRCH. Handle this gracefully instead of throwing in the towel.
basic/macro: Undef align on FreeBSD
This silences a lot of warnings.
bus-creds: Skip parse caps instead of -ENOTSUP
This means that we just interpret processes as having no capabilities,
rather than causing errors that terminate bus_cred setup.
bus-socket: Skip cap check instead of -ENOSYS
Returning -ENOSYS meant that any permission check would fail if we
didn't have capabilities, which lead us to fail before seeing that
server/client were the same PID, which is special-cased to be okay.
Instead set -1, so that we just skip capability tests.
bus-socket: Implement explicit credential passing
D-Bus EXTERNAL authentication on UNIX works by sending a single
null-byte with SCM_CREDENTIALS/SCM_CREDS attached, which is an explicit
credential passing mechanism.
Various OS's, including Linux and FreeBSD, support various degrees of
implicit credential passing where one can inspect the credentials of the
"remote" process of a socket.
The official D-Bus implementation, systemd, relies on implicit
passing on Linux. However, despite this being available, D-Bus still
relies on explicit credential passing on FreeBSD, which basu was not
Add explicit credential passing for both Linux and FreeBSD to increase
bus-socket: Remove (read|write)v usage
We don't support alternative transports, and require the ability to send
control messages to authenticate correctly, so kill this with fire.
ci: Generate dbus uuid on FreeBSD
sd-id128: Check /var/lib/dbus/machine-id
/etc/machine-id is a systemd-ism, and non-systemd machines may have the
file in its original location, which is /var/lib/dbus/machine-id.
test: Disable test-bus-benchmark
basic/memfd: Skip sealing on FreeBSD < 13
FreeBSD 13 should support the sealing done here, but FreeBSD 12 does
not. It does not seem that important, so let us just skip it for now.