summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* networkd-ipv4acd.c: Use net/if.h for getting IFF_LOOPBACK definitionKhem Raj2022-11-091-1/+2
| | | | | | | This helps in avoiding compiling errors on musl. Definition of IFF_LOOPBACK is the reason for including linux/if_arp.h, this however could be obtained from net/if.h glibc header equally and makes it portable as well.
* dissect: grey out trailing slash in --list outputLennart Poettering2022-11-081-1/+1
| | | | | Given this is just auxiliary info, let's make it a tiny bit less visible then the main part of the path.
* kernel-install: skip 50-depmod if depmod is not availableLuca Boccassi2022-11-071-0/+1
| | | | | | | Images might be built without any kernel module, and without installing depmod as it is not needed. Skip it. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607
* Merge pull request #25286 from mrc0mmand/systemd-mount-test-fixLuca Boccassi2022-11-071-1/+0
|\ | | | | test: replace tmpfs with vfat when testing --owner=
| * Revert "mountpoint-util: tmpfs supports uid=/gid= mount options"Frantisek Sumsal2022-11-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7d4f00c88c65532bf66d20b3ec498b5bfaa621d2. fstype_can_uid_gid() is about fixating all files to the specified uid/gid. tmpfs does not qualify. The uid/gid parameter there is simply about the default uid/gid for the root inode of the tmpfs, it allows setting uids/gid arbirarily for all inodes after that. This distinction matters: for file systems this function returns true for we can use this in place of uidmapped mounts. But for tmpfs this is not going to work, given inodes on that fs can end up having arbitrary uid/gid. See: https://github.com/systemd/systemd/pull/25284#issue-1438427144
* | kernel-install/90-loaderentry: do not override an existing systemd.machine_idAntonio Alvarez Feijoo2022-11-071-1/+1
| | | | | | | | | | If the systemd.machine_id command line option is already set, do not override it.
* | Merge pull request #25282 from keszybz/trivial-cleanupsYu Watanabe2022-11-072-8/+7
|\ \ | |/ |/| Trivial cleanups
| * udevadm: merge two log stmtsZbigniew Jędrzejewski-Szmek2022-11-071-5/+4
| |
| * sd-event: adjust indentationZbigniew Jędrzejewski-Szmek2022-11-071-3/+3
| |
* | test: compile test-utmp.c only if UTMP is enabledTorsten Hilbrich2022-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling with -D utmp=false the compilation fails with: ../../git/systemd/src/test/test-utmp.c: In function ‘test_dump_run_utmp’: ../../git/systemd/src/test/test-utmp.c:21:9: error: cleanup argument not a function 21 | _unused_ _cleanup_(utxent_cleanup) bool utmpx = false; | ^~~~~~~~ ../../git/systemd/src/test/test-utmp.c:23:17: error: implicit declaration of function ‘utxent_start’ [-Werror=implicit-function-declaration] 23 | utmpx = utxent_start(); | ^~~~~~~~~~~~ any many other errors Add a conditional to compile test-utmp.c only if ENABLE_UTMP is true.
* | Merge pull request #25277 from mrc0mmand/also-coverageYu Watanabe2022-11-071-0/+1
|\ \ | |/ |/| test: add coverage for systemd-mount
| * mountpoint-util: tmpfs supports uid=/gid= mount optionsFrantisek Sumsal2022-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As tmpfs(5) says, both uid= and gid= are supported since kernel 2.5.7 and the mount utility seems to agree: ``` # stat -c "%U:%G" mnt root:root # mount -o uid=testuser,gid=testuser -t tmpfs tmpfs mnt # stat -c "%U:%G" mnt testuser:testuser ``` However, systemd-mount currently complains: ``` # systemd-mount --owner testuser -t tmpfs tmpfs mnt File system type tmpfs is not known to support uid=/gid=, refusing. ```
* | Merge pull request #25266 from poettering/dissect-fsck-fixLennart Poettering2022-11-075-7/+48
|\ \ | | | | | | dissect: fix fsck invocation
| * | dissect: fix fsckLennart Poettering2022-11-041-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since f7725647bb41c3398a867f139efe526efe8aa1b3 when dissecting a disk image we operate with fds to the device nodes in question wherever we can. This includes when we fork off fsck, where we pass a /proc/self/fd/ path as argument. This only works if we keep that fd open however and disable O_CLOEXEC on the fd. Hence do so, and fix fsck this way. (Without this, all fsck will fail, since the fd path is invalid)
| * | process-util: add new FORK_CLOEXEC_OFF flag for disabling O_CLOEXEC on ↵Lennart Poettering2022-11-042-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | remaining fds Often the fds that shall stay around in the child shall be passed to a process over execve(), hence add an option to explicitly disable O_CLOEXEC on them in the child.
| * | fd-util: add new fd_cloexec_many() helperLennart Poettering2022-11-042-0/+20
| | |
| * | fd-util: make fd_in_set() (and thus close_all_fds()) handle invalidated fds ↵Lennart Poettering2022-11-041-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | in the array let's handle gracefully if fds in the specified array are already invalidated (i.e. negative). This is handy when putting together arrays on the fly.
* | | Merge pull request #25107 from lucab/ups/sysusers-gid-check-usernameLuca Boccassi2022-11-061-9/+19
|\ \ \ | | | | | | | | sysusers: cross-check user and group names too
| * | | sysusers: cross-check user and group names tooLuca BRUNO2022-11-031-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an additional name check when cross-matching new group entries against existing users, which allows coalescing entries matching both ID and name. It provides a small idempotence enhancement when creating groups in cases where matching user entries are in place. By fine-tuning the conflict detection logic, this avoids picking up new random IDs and correctly prefers configuration values instead.
* | | | loop-util: open lock fd read-onlyChristian Göttsche2022-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | flock(2) works with file descriptors opened with O_RDONLY. This affects SELinux systems where access to block devices is quite restricted to avoid bypasses on filesystem objects.
* | | | core: update audit messagesChristian Göttsche2022-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | Pass getuid() instead of literal `0` as auid, since user session managers also issue audit messages on SELinux denials.
* | | | dissect: get rid of basename() useLennart Poettering2022-11-051-9/+16
| |/ / |/| |
* | | kernel-install/90-loaderentry: do not add multiple systemd.machine_id optionsAntonio Alvarez Feijoo2022-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Do not unconditionally add a new systemd.machine_id command line option, first check if it already exists with the expected value. Fixes #25203
* | | resolve: enable per-link mDNS setting by defaultYu Watanabe2022-11-042-5/+5
| | | | | | | | | | | | | | | | | | | | | Otherwise, if the link is not managed by systemd-networkd, mDNS cannot be enabled without calling `resolvectl` explicitly. Fixes #25252.
* | | Merge pull request #25244 from yuwata/reboot-util-follow-upsLuca Boccassi2022-11-042-10/+5
|\ \ \ | |_|/ |/| | reboot-util: several cleanups
| * | reboot-util: drop unnecessary castYu Watanabe2022-11-041-3/+3
| | | | | | | | | | | | Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
| * | reboot-util: drop redundant headersYu Watanabe2022-11-041-5/+0
| | | | | | | | | | | | Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
| * | meson: sort librariesYu Watanabe2022-11-041-2/+2
| |/ | | | | | | | | | | Except for 'threads'. Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
* / firstboot: fix segfault when --locale-messages= is passed without --locale=Luca Boccassi2022-11-041-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \#0 __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:295 No locals. \#1 0x0000557444eb172b in process_locale () at ../src/firstboot/firstboot.c:342 etc_localeconf = 0x7ffd40217b80 "/root/root/etc/locale.conf" locales = {0x0, 0x0, 0x0} i = 0 r = <optimized out> __PRETTY_FUNCTION__ = "process_locale" __func__ = "process_locale" \#2 0x0000557444eaff93 in run (argv=0x7ffd40217d98, argc=3) at ../src/firstboot/firstboot.c:1401 loop_device = 0x0 unlink_dir = 0x0 r = <optimized out> loop_device = <optimized out> unlink_dir = <optimized out> r = <optimized out> __func__ = <optimized out> __PRETTY_FUNCTION__ = <optimized out> enabled = <optimized out> _error = <optimized out> _level = <optimized out> _e = <optimized out> _level = <optimized out> _e = <optimized out> \#3 main (argc=3, argv=0x7ffd40217d98) at ../src/firstboot/firstboot.c:1432 r = <optimized out> __PRETTY_FUNCTION__ = "main" Fixes https://github.com/systemd/systemd/issues/25249
* shutdown: Add Xen kexec supportSamuel Thibault2022-11-028-12/+95
| | | | | | In the Xen case, it's the hypervisor which manages kexec. We thus have to ask it whether a kernel is loaded, instead of relying on /sys/kernel/kexec_loaded.
* core: fix memleak in GetUnitFileLinks methodYu Watanabe2022-11-021-5/+11
|
* update credentials when reloading a serviceJörg Thalheim2022-11-011-1/+1
| | | | | | | | Many long-running services will reload configuration and therefore credentials on reload. Therefore its useful if a service reload will also update credentials. Tested in https://github.com/numtide/systemd-vaultd/pull/12
* Merge pull request #25192 from yuwata/wait-online-altnameLuca Boccassi2022-11-014-19/+114
|\ | | | | wait-online: support alternative interface names
| * network: update commentYu Watanabe2022-11-011-1/+1
| |
| * wait-online: support alternative namesYu Watanabe2022-11-013-4/+68
| |
| * wait-online: check received interface nameYu Watanabe2022-11-011-0/+13
| |
| * wait-online: split out link_update_name()Yu Watanabe2022-11-011-14/+30
| | | | | | | | | | No functional changes, just refactoring and preparation for later commits.
| * wait-online: ignore one more error in callback functionYu Watanabe2022-11-011-3/+5
| |
* | namespace: Add hidepid/subset support checkDaan De Meyer2022-11-012-6/+81
| | | | | | | | | | | | Using fsopen()/fsconfig(), we can check if hidepid/subset are supported to avoid the noisy logs from the kernel if they aren't supported. This works on centos/redhat 8 as well since they've backported fsopen()/fsconfig().
* | condition: Check that subsystem is enabled in ConditionSecurity=tpm2Daan De Meyer2022-11-014-13/+19
| | | | | | | | | | | | | | | | | | Instead of succeeding when either the firmware reports a TPM device or we find a TPM device, let's check that the firmware reports a TPM device and the TPM subsystem is enabled in the kernel. To check whether the subsystem enabled, we check if the relevant subdirectory in /sys exists at all.
* | network: forcibly reconfigure all interfaces after sleepYu Watanabe2022-11-012-65/+11
| | | | | | | | | | | | | | Previously, interfaces are partially reconfigured in a spurious way. Let's use the same way as `networkctl reconfigure`. Hopefully fixes #14987 and #24997.
* | coverage: Mark _coverage__exit as noreturnJan Janssen2022-11-011-1/+1
| | | | | | | | | | ../src/basic/coverage.h:15:48: warning: function '_coverage__exit' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
* | resolved: fix typo in feature level tableYoufu Zhang2022-11-011-1/+1
|/
* Merge pull request #25143 from yuwata/network-reconfigure-interface-when-renamedLuca Boccassi2022-10-312-46/+84
|\ | | | | network: reconfigure interface when renamed
| * network: try to reconfigure when some information is updatedYu Watanabe2022-10-311-25/+36
| | | | | | | | | | | | | | | | When at least one of the name, MAC address, udev properties, and so on for an interface is updated, try to find a matching .network file, and reconfigure if a new .network file is assigned. Fixes #24975.
| * network: simplify the logic of reading driver and permanent HW addressYu Watanabe2022-10-312-11/+41
| | | | | | | | | | | | | | | | No functional changes, just refactoring and preparation for later commits. Note, `link->dev` should always exist when link state is initialized or later.
| * network: allow to (automatically) reconfigure failed interfaceYu Watanabe2022-10-271-1/+1
| | | | | | | | | | | | | | | | We have already allowed to reconfigure failed interface manually, but not allowed to do automatically, e.g. on carrier gain. This makes that failed interfaces also reconfigured automatically. Note, the condition is inversed to shorten the condition.
| * network: drop redundant conditionYu Watanabe2022-10-271-9/+6
| | | | | | | | | | The function `link_reconfigure_impl()` has the same condition at the beginning.
* | network: skip to reassign master ifindex if already setYu Watanabe2022-10-311-0/+8
| | | | | | | | | | | | | | Otherwise, the slave interface may go down, especially when the master is bond. Fixes #25067.
* | udev: drop trivial wrapper for udev_watch_begin()Yu Watanabe2022-10-314-23/+9
| |