Commit graph

69685 commits

Author SHA1 Message Date
Lennart Poettering d02d4f83f0 terminal-util: add helper for disabling terminal echo in termios struct 2023-12-21 19:15:01 +01:00
Lennart Poettering b0936baf11 mkosi: don't turn off installation of our PAM snippets
Otherwise we don't get the new PAM snippet for the uid0 PAM stack
installed.
2023-12-21 19:14:43 +01:00
Lennart Poettering 1072d94731 run: optionally set the "ignore-failure" flag for ExecStart= lines 2023-12-21 19:14:43 +01:00
Lennart Poettering 72eb3081b2 run: when invoked as "uid0", expose some sudo-like behaviour
This turns "systemd-run" into a multi-call binary. When invoked under
the name "uid0", then it behaves a bit more like traditional "sudo".
This mostly means defaults appropriuate for that, for example a PAM
stack, interactivity and more.

Fixes: #29199
2023-12-21 19:14:43 +01:00
Lennart Poettering 20f8b345db env-util: add strv_env_assignf() helper 2023-12-21 19:07:29 +01:00
Yu Watanabe 207aafe7e1
Merge pull request #30567 from yuwata/hashmap_isempty
tree-wide: use hashmap_isempty() and friends
2023-12-22 02:36:19 +09:00
Yu Watanabe 187f920713
Merge pull request #30564 from poettering/varlink-log-tweaks
varlink: minor fixes & tweaks
2023-12-22 02:31:09 +09:00
Yu Watanabe 6280da4746
Merge pull request #30563 from poettering/socket-tweaks
two minor tweak to socket-util.c
2023-12-22 02:30:46 +09:00
Yu Watanabe 474536c949 sd-journal: use FOREACH_ARRAY() at one more place 2023-12-22 01:28:44 +09:00
Yu Watanabe 43127aebc7 tree-wide: use hashmap_isempty() and friends 2023-12-22 01:27:09 +09:00
Lennart Poettering 7ff96ce383 varlink: check state rather than flags to determine whether it makes sense to reply
We already checked the flags before, and updated the state accordingly,
hence let's only look at the state afterwards. This allows us to use the
same expressions for all cases where we want to reply automatically to
clients.
2023-12-21 15:28:01 +01:00
Lennart Poettering a13518231a varlink: add an extra assert encoding our assumption that ucred is valid here 2023-12-21 15:27:37 +01:00
Lennart Poettering c931c871aa varlink: never turn method call handler errors into connection errors
Let's make sure method call handlers failing will result in that very
method call failing but not the whole connection. We mostly got that
right, except for "oneway" calls where the method reply is supposed to
be eaten up, but wasn't. Fix that.
2023-12-21 15:25:46 +01:00
Lennart Poettering 6bcc12325b varlink: switch various log calls to the local log helpers
Most code in varlink.c got that right, but some didn't. Fix that.
2023-12-21 15:24:32 +01:00
Lennart Poettering fccad70602 socket-util: remove unnecessary variable 2023-12-21 15:22:16 +01:00
Lennart Poettering 989740ebc4 socket-util: make sure SO_PEERSEC returned string is always NUL terminated
it's not entirely clear to me if the manual NUL termination is
necessary, but let's better be safe than sorry, since this is apparently
up to the LSMs, and I am not sure we can trust them all.

A lot of other code (such as dbus-broker) patches in the NUL byte, hence
let's be rather safe-then-sorry, it's trivial after all.
2023-12-21 15:21:23 +01:00
Lennart Poettering a6076499db dbus-execute: use new exec_context_get_set_login_environment() helper also as backing for dbus property
Note sure why it didn't occur earlier to me, but now that we have this
nice helper to get the effective value of the set_login_environment
field instead of just falling back to "false".

Follow-up for: #30552
2023-12-21 22:06:40 +09:00
Michal Sekletar 3b4cc1437b resolved: actually check authenticated flag of SOA transaction
Fixes #25676
2023-12-21 18:54:21 +09:00
Lennart Poettering d1a5be82ef core: imply SetLoginEnvironment= if PAMName= is set
This geneally makes sense as setting up a PAM session pretty much
defines what a login session is.

In context of #30547 this has the benefit that we can take benefit of
the SetLoginEnvironment= effect without having to set it explicitly,
thus retaining some compat of the uid0 client towards older systemd
service managers.
2023-12-21 10:14:21 +01:00
Yu Watanabe e36d8e4858 network: merge two post event sources
No functional change, just refactoring.
2023-12-21 04:27:52 +09:00
Yu Watanabe 2e1113b7d0 network: split out manager_clean_all() from manager_dirty_handler()
And rename manager_dirty_handler() to manager_post_handler().

No functional change, just refactoring.
2023-12-21 04:27:09 +09:00
Yu Watanabe 93db44eadb network/nexthop: check if nexthop is really configured without ID 2023-12-21 04:22:46 +09:00
Yu Watanabe fb126bb168 network/nexthop: cache requested nexthop IDs 2023-12-21 04:22:46 +09:00
Yu Watanabe 015b243207 network/nexthop: drop conflicting [NextHop] sections 2023-12-21 04:22:46 +09:00
Yu Watanabe 84ec2fdaf3 network/nexthop: check if on-link is not enabled for group or blackhole nexthop 2023-12-21 04:22:46 +09:00
Yu Watanabe 4464c3205c network/nexthop: fix wrong verification
This checks the nexthop is not a blackhole, gateway is unrelated.
2023-12-21 04:22:46 +09:00
Yu Watanabe c1e0890004 network/nexthop: add several assertions related to nexthop ID 2023-12-21 04:22:46 +09:00
Yu Watanabe 462877f060 network/nexthop: drop dead code
Follow-up for a533473a48.
2023-12-21 04:22:46 +09:00
Yu Watanabe 3a2ef59d2e test-network: add test case of an empty string assignment for Address= 2023-12-21 04:13:19 +09:00
Yu Watanabe 67150a7bd4 test-network: use the main .network file
These tests are not interested in most addresses specified in the .network file.
As 10-many-address.conf drop-in config for the .network file contains so
many addresses, hopefully this improves test performance.
2023-12-21 04:10:19 +09:00
Yu Watanabe a61738b3a6 network/address: make Address= in [Network] support an empty string
Closes #30485.
2023-12-21 04:08:53 +09:00
Yu Watanabe b993e7e72e network: also log drop-in config files
We have already show used drop-in config files in networkctl, but
also showing that in log may be useful.

Closes #30483.
2023-12-21 03:37:17 +09:00
Yu Watanabe 935cf7b3a1
Merge pull request #30548 from yuwata/analyze-check-all-executables
analyze: check all executables
2023-12-21 03:36:35 +09:00
Yu Watanabe 47ac844ee6 network/neighbor: fix log message and comment 2023-12-21 03:33:58 +09:00
Mike Yuan bc9e592c4f systemctl: configure boot loader options only when going through firmware
Fixes #30497
2023-12-21 01:35:55 +09:00
Yu Watanabe c780591bba
Merge pull request #30538 from poettering/ptyfwd-reset-color
ptyfwd: reset colors when we exit the pty forwarding logic
2023-12-21 01:17:00 +09:00
Yu Watanabe 0d1290977d
Merge pull request #30543 from YHNdnzj/execute-cleanup
core/execute: trivial cleanup
2023-12-21 01:16:34 +09:00
Yu Watanabe abf0ccc1c6 analyze-verify: verify all executables
ExecStart= and friends for .service and .socket can be specified
multiple times.
This also checks all commands for .mount and .swap, not only for the
current control command.
2023-12-20 23:56:16 +09:00
Yu Watanabe 5183976cea TEST-65-ANALYZE: only mount /usr if necessary
Follow-up for 8f764b32ea.

Otherwise, we fail to umount several directories on shutdown.
---
[   15.684430] systemd[1]: Failed unmounting tmp-root-proc.mount.
[   15.689379] systemd[1]: Failed unmounting tmp-root-run.mount.
[   15.710572] systemd[1]: Failed unmounting tmp-root-sys-fs-cgroup.mount.
[   15.913953] systemd[1]: Failed unmounting tmp-root-dev.mount.
[   15.924603] systemd[1]: Failed unmounting tmp-root-sys.mount.
[   15.938207] systemd[1]: Failed unmounting tmp-root.mount.
[   15.952395] systemd[1]: Failed unmounting tmp.mount.
2023-12-20 23:56:16 +09:00
Lennart Poettering 518c4f0488 ptyfwd: make sure pty_forward_free() follows our usual semantics regarding NULL 2023-12-20 15:49:59 +01:00
Lennart Poettering e7d2b00e0d ptyfwd: reset colors when we exit the pty forwarding logic
Just in case there was still a color set, make sure to reset things.
2023-12-20 15:49:09 +01:00
Yu Watanabe 760e7a3cb1
Merge pull request #30537 from poettering/run-arg-service-type-fix
run: arg_service_type is not supposed to be allocated from heap
2023-12-20 23:46:11 +09:00
Yu Watanabe 63d0491bbc
Merge pull request #30536 from yuwata/network-bridge-vlan-debugging-logs
network/bridge-vlan: add debugging logs and documentation update
2023-12-20 23:46:01 +09:00
Mike Yuan e03975b90f
core/execute: use assertion for _done function
As per our usual coding style.
2023-12-20 21:56:49 +08:00
Mike Yuan a7774a8ccb
core/execute: remove unneeded brackets
I did not merge the if-s, since I think it's easier to read
in the current form with those long socketpair() calls.
2023-12-20 21:52:59 +08:00
Daan De Meyer 929f41c652 bootctl: update/list/remove all instances of systemd-boot in /EFI/BOOT
systemd-boot might be installed in /EFI/BOOT under more names than
just /EFI/BOOT/BOOTX64.efi. The prime example is shim which loads
its second stage binary from /EFI/BOOT/grubx64.efi. To accomodate
use cases where systemd-boot is installed as /EFI/BOOT/grubx64.efi,
let's always check the entire /EFI/BOOT directory for binaries that
identify as systemd-boot and list/update/remove those as well.

Let's keep this somewhat generic though and not install ourselves as
grubx64.efi since that would mean having to check for shim which is
a can of worms we probably don't want to open.
2023-12-20 13:56:02 +01:00
Franck Bui 3553fddb1e rules: set up tty permissions and group for /dev/hvc* nodes
Before b4bf9007cb, the permissions and group of the hypervisor consoles were
set by agetty(8).
2023-12-20 21:01:05 +09:00
Yu Watanabe 8f876e8d98
Merge pull request #30525 from YHNdnzj/networkctl-mask
networkctl: introduce verb mask and unmask
2023-12-20 21:00:36 +09:00
Lennart Poettering e132be4642 run: underline section titles in --help as we usually do 2023-12-20 12:14:24 +01:00
Lennart Poettering 4b5baf7514 run: arg_service_type is not supposed to be allocated from heap 2023-12-20 12:13:18 +01:00