summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* meson: Disable dmi_memory_id on arches without DMIwip/hadess/unsupported-dmiBastien Nocera2020-12-163-3/+10
|
* meson: Split off udev helper programs arrayBastien Nocera2020-12-161-1/+2
|
* udev: Extract RAM properties from DMI informationBastien Nocera2020-12-1611-0/+859
| | | | | | | | | Add memory_id program to set properties about the physical memory devices in the system. This is useful on machines with removable memory modules to show how the machine can be upgraded, and on all devices to detect the actual RAM size, without relying on the OS accessible amount. Closes: #16651
* tree-wide: fix typoYu Watanabe2020-12-163-4/+4
|
* test-login: skip consistency checks when logind is not activeZbigniew Jędrzejewski-Szmek2020-12-161-48/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways in swich sd_login_* functions acquire data: some are derived from the cgroup path, but others use the data serialized by logind. When the tests are executed under Fedora's mock, without systemd-spawn but instead in a traditional chroot, test-login gets confused: the "outside" cgroup path is visible, so sd_pid_get_unit() and sd_pid_get_session() work, but sd_session_is_active() and other functions that need logind data fail. Such a buildroot setup is fairly bad, but it can be encountered in the wild, so let's just skip the tests in that case. /* Information printed is from the live system */ sd_pid_get_unit(0, …) → "session-237.scope" sd_pid_get_user_unit(0, …) → "n/a" sd_pid_get_slice(0, …) → "user-1000.slice" sd_pid_get_session(0, …) → "237" sd_pid_get_owner_uid(0, …) → 1000 sd_pid_get_cgroup(0, …) → "/user.slice/user-1000.slice/session-237.scope" sd_uid_get_display(1000, …) → "(null)" sd_uid_get_sessions(1000, …) → [0] "" sd_uid_get_seats(1000, …) → [0] "" Assertion 'r >= 0' failed at src/libsystemd/sd-login/test-login.c:104, function test_login(). Aborting.
* networkd: handle ignoring ll gateway being link llDevon Pringle2020-12-161-3/+13
| | | | | | | | | | | | | In the event where network discovery gets a route with the gateway being the interfaces local link address, networkd will fail the interface. systemd-networkd[44319]: br_lan: Configuring route: dst: fdcd:41a4:5559:ec03::/64, src: n/a, gw: fe80::e4da:7eff:fe77:5c5e, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast systemd-networkd[44319]: br_lan: Could not set NDisc route or address: Gateway can not be a local address. Invalid argument systemd-networkd[44319]: br_lan: Failed systemd-networkd[44319]: br_lan: State changed: configuring -> failed This patch, instead of allowing the interface to fail, will instead log the event and skip setting the route.
* Merge pull request #17799 from yuwata/oss-fuzz-25353Zbigniew Jędrzejewski-Szmek2020-12-169-54/+66
|\ | | | | logs-show: skip non-utf8 name entries
| * logs-show: refuse data which contain invalid fieldsYu Watanabe2020-12-161-12/+20
| |
| * journal: refuse data which contain invalid fieldsYu Watanabe2020-12-162-0/+3
| | | | | | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25353.
| * journal: move journal_field_valid() to journal_file.cYu Watanabe2020-12-167-42/+43
| |
* | Translated using Weblate (Swedish)Luna Jernberg2020-12-161-15/+12
| | | | | | | | | | | | | | | | Currently translated at 67.3% (126 of 187 strings) Co-authored-by: Luna Jernberg <bittin@reimu.nl> Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/sv/ Translation: systemd/master
* | tree-wide: fix typoYu Watanabe2020-12-164-4/+4
| |
* | Merge pull request #17859 from ↵Yu Watanabe2020-12-1727-433/+598
|\ \ | | | | | | | | | | | | keszybz/hostnamed-export-hostname-origin-and-simplify-logic Export hostname origin and simplify logic in hostamed
| * | hostnamed,shared/hostname-setup: expose the origin of the current hostnameZbigniew Jędrzejewski-Szmek2020-12-166-60/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In hostnamed this is exposed as a dbus property, and in the logs in both places. This is of interest to network management software and such: if the fallback hostname is used, it's not as useful as the real configured thing. Right now various programs try to guess the source of hostname by looking at the string. E.g. "localhost" is assumed to be not the real hostname, but "fedora" is. Any such attempts are bound to fail, because we cannot distinguish "fedora" (a fallback value set by a distro), from "fedora" (received from reverse dns), from "fedora" read from /etc/hostname. /run/systemd/fallback-hostname is written with the fallback hostname when either pid1 or hostnamed sets the kernel hostname to the fallback value. Why remember the fallback value and not the transient hostname in /run/hostname instead? We have three hostname types: "static", "transient", fallback". – Distinguishing "static" is easy: the hostname that is set matches what is in /etc/hostname. – Distingiushing "transient" and "fallback" is not easy. And the "transient" hostname may be set outside of pid1+hostnamed. In particular, it may be set by container manager, some non-systemd tool in the initramfs, or even by a direct call. All those mechanisms count as "transient". Trying to get those cases to write /run/hostname is futile. It is much easier to isolate the "fallback" case which is mostly under our control. And since the file is only used as a flag to mark the hostname as fallback, it can be hidden inside of our /run/systemd directory. For https://bugzilla.redhat.com/show_bug.cgi?id=1892235.
| * | hostnamed: stop discriminating against "localhost" in /etc/hostnameZbigniew Jędrzejewski-Szmek2020-12-162-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would sometimes ignore localhost-style names in /etc/hostname. That is brittle. If the user configured some hostname, it's most likely because they want to use that as the hostname. If they don't want to use such a hostname, they should just not create the config. Everything becomes simples if we just use the configured hostname as-is. This behaviour seems to have been a workaround for Anaconda installer and other tools writing out /etc/hostname with the default of "localhost.localdomain". Anaconda PR to stop doing that: https://github.com/rhinstaller/anaconda/pull/3040. That might have been useful as a work-around for other programs misbehaving if /etc/hostname was not present, but nowadays it's not useful because systemd mostly controls the hostname and it is perfectly happy without that file. Apart from making things simpler, this allows users to set a hostname like "localhost" and have it honoured, if such a whim strikes them.
| * | hostnamed: improve message about static hostnameZbigniew Jędrzejewski-Szmek2020-12-161-1/+4
| | | | | | | | | | | | Changed static hostname to 'n/a' is not very nice.
| * | hostnamed: minor style cleanupsZbigniew Jędrzejewski-Szmek2020-12-162-8/+4
| | |
| * | hostnamed: when hostname is set to existing value, suppress notificationsZbigniew Jędrzejewski-Szmek2020-12-161-7/+11
| | | | | | | | | | | | | | | When the hostname is set through network config or such, let's optimize things a bit by suppressing the logs and dbus notifications.
| * | shared/hostname-setup: leave the terminator byte aloneZbigniew Jędrzejewski-Szmek2020-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | gethostname(3) says it's unspecified whether the string is properly terminated when the hostname is too long. We created a buffer with one extra byte, and it seems the intent was to let that byte serve as terminator even if we get an unterminated string from gethostname().
| * | shared/hostname-setup: add mode where we check what would be set, without doingZbigniew Jędrzejewski-Szmek2020-12-165-17/+23
| | | | | | | | | | | | This allows the 'unsafe' mark to be removed from the test.
| * | Move hostname setup logic to new shared/hostname-setup.[ch]Zbigniew Jędrzejewski-Szmek2020-12-1620-280/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional change, just moving a bunch of things around. Before we needed a rather complicated setup to test hostname_setup(), because the code was in src/core/. When things are moved to src/shared/ we can just test it as any function. The test is still "unsafe" because hostname_setup() may modify the hostname.
| * | hostnamed: fix return valueZbigniew Jędrzejewski-Szmek2020-12-161-2/+4
| | |
| * | hostnamed: expose the fallback-hostname setting as a const dbus propertyZbigniew Jędrzejewski-Szmek2020-12-162-0/+11
| | | | | | | | | | | | | | | | | | Various users want to know what the fallback hostname is. Since it was made configurable in 8146c32b9264a6915d467a5cab1a24311fbede7e, we didn't expose this nicely.
| * | man/hostnamectl,hostaned,hostname1: adjust the docs to match realityZbigniew Jędrzejewski-Szmek2020-12-164-89/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantics were significantly changed in c779a44222161155c039a7fd2fd304c006590ac7 ("hostnamed: Fix the way that static and transient host names interact", Feb. 2014), but when the dbus api documentation was imported much later, it wasn't properly adjusted to describe those new semantics. 34293dfafd2a81d80727938199769906dab321bd which added systemd.hostname= also added new behaviour. Let's ove various bits and pieces around so that they are in more appropriate places. Drop recommendations to set the hostname for DHCP or mDNS purposes. Nowadays we expect tools that want to expose some different hostname to the outside to manage that internally without affecting visible state. Also drop mentions of DHCP or mDNS directly setting the hostname, since nowadays network management software is expected to (and does) go through hostnamed. Also, add a high-level description of semantics. It glosses over the details of handling of localhost-style names. Later commits will remove this special handling anyway.
* | | sd-netlink: routing policy rule port to fib_rule_hdrSusant Sahani2020-12-173-71/+70
| | |
* | | resolved: always take a timestamp when first seeing a packetLennart Poettering2020-12-164-4/+5
| | | | | | | | | | | | | | | This is later useful if we want to adjust the TTLs of packets we want to propagate to clients.
* | | sd-dhcp-client: fix renew/rebind timeout calculation to avoid infinite loopDan Streetman2020-12-161-1/+1
|/ / | | | | | | | | | | | | unfortunately I missed adding the timeout to 'now' which results in an endless loop of renewal timeouts. Fixes: 3a23834d6b0da391c1ba9cb79a7d7deea7125f4b
* | coredumpctl: Add --debugger-args= optionMichal Fabik2020-12-163-38/+77
| | | | | | | | | | | | | | This commit adds the possibility to pass command line options to the debugger invoked with coredumpctl debug. Resolves: #9905
* | Merge pull request #17968 from yuwata/purge-libudevYu Watanabe2020-12-1628-463/+452
|\ \ | | | | | | udev: do not link with libudev
| * | udev: drop license boilerplateYu Watanabe2020-12-161-9/+1
| | |
| * | rules: drop broken linksYu Watanabe2020-12-162-4/+0
| | |
| * | meson: do not link with libudevYu Watanabe2020-12-166-44/+36
| | |
| * | udev: drop unnecessary libudev-util.h inclusionsYu Watanabe2020-12-1610-10/+0
| | |
| * | udevadm: drop udev_queueYu Watanabe2020-12-161-9/+10
| | |
| * | udev: introduce udev_queue_is_empty() and udev_queue_init()Yu Watanabe2020-12-163-19/+34
| | |
| * | libudev: fix indentationYu Watanabe2020-12-161-1/+1
| | |
| * | libudev: drop unnecessary headers from libudev-util.cYu Watanabe2020-12-161-8/+0
| | |
| * | udev: use encode_devnode_name() instead of udev_util_encode_string()Yu Watanabe2020-12-163-7/+10
| | | | | | | | | | | | | | | As udev_util_encode_string() is a simple wrapper of encode_devnode_name().
| * | udev: rename UTIL_LINE_SIZE -> UDEV_LINE_SIZE and friendsYu Watanabe2020-12-167-34/+34
| | | | | | | | | | | | This also moves them to udev-util.h
| * | udev: move util_resolve_subsys_kernel() to udev-util.cYu Watanabe2020-12-168-97/+104
| | |
| * | udev: move util_replace_chars() to udev-util.cYu Watanabe2020-12-1610-66/+68
| | |
| * | udev: move util_path_encode() and rename it to escape_path()Yu Watanabe2020-12-163-36/+35
| | |
| * | udev: move util_replace_whitespace() to udev-util.cYu Watanabe2020-12-1610-119/+119
| |/
* | network: Allow to configure interface promiscuous modeSusant Sahani2020-12-156-4/+21
| |
* | test: use modern qemu numa argumentsChristian Ehrhardt2020-12-162-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrading to qemu 5.2 breaks TEST-36-NUMAPOLICY like: qemu-system-x86_64: total memory for NUMA nodes (0x0) should equal RAM size (0x20000000) Use the new (as in >=2014) form of memdev in test 36: -object memory-backend-ram,id=mem0,size=512M -numa node,memdev=mem0,nodeid=0 Since some target systems are as old as qemu 1.5.3 (CentOS7) but the new kind to specify was added in qemu 2.1 this needs to add version parsing and add the argument only when qemu is >=5.2. Fixes #17986. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
* | Merge pull request #17967 from poettering/connect-user-busLennart Poettering2020-12-1545-161/+410
|\ \ | | | | | | add support for "systemctl --user --machine=foobar@.host" for connecting to user bus of user "foobar"
| * | bus-util: improve logging when we can't connect to the busLennart Poettering2020-12-151-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we'd already have explicit logging for the case where $XDG_RUNTIME_DIR is not set. Let's also add some explicit logging for the EPERM/ACCESS case. Let's also in both cases suggest the --machine=<user>@.host syntax. And while we are at it, let's remove side-effects from the macro. By checking for both the EPERM/EACCES case and the $XDG_RUNTIME_DIR case we will now catch both the cases where people use "su" to issue a "systemctl --user" operation, and those where they (more correctly, but still not good enough) call "su -". Fixes: #17901
| * | stdio-bridge: add support for --system and --userLennart Poettering2020-12-151-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, the bridge always acted as if "--system" was used, i.e. would unconditionally connect to the system bus. Let's add "--user" too, to connect to the users session bus. This is mostly for completeness' sake. I wanted to use this when making sd-bus's ability to connect to other user's D-Bus busses work, but it didn't exist so far. In the interest of keeping things compatible the implementation in sd-bus will not use the new "--user" switch, and instead manually construct the right bus path via "--path=", but we still should add the proper switches, as preparation for a brighter future, one day.
| * | man: document new ability to connect to user of containerLennart Poettering2020-12-152-4/+28
| | |
| * | sd-bus: add API for connecting to a specific user's user bus of a specific ↵Lennart Poettering2020-12-158-22/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container This is unfortunately harder to implement than it sounds. The user's bus is bound a to the user's lifecycle after all (i.e. only exists as long as the user has at least one PAM session), and the path dynamically (at least theoretically, in practice it's going to be the same always) generated via $XDG_RUNTIME_DIR in /run/. To fix this properly, we'll thus go through PAM before connecting to a user bus. Which is hard since we cannot just link against libpam in the container, since the container might have been compiled entirely differently. So our way out is to use systemd-run from outside, which invokes a transient unit that does PAM from outside, doing so via D-Bus. Inside the transient unit we then invoke systemd-stdio-bridge which forwards D-Bus from the user bus to us. The systemd-stdio-bridge makes up the PAM session and thus we can sure tht the bus exists at least as long as the bus connection is kept. Or so say this differently: if you use "systemctl -M lennart@foobar" now, the bus connection works like this: 1. sd-bus on the host forks off: systemd-run -M foobar -PGq --wait -pUser=lennart -pPAMName=login systemd-stdio-bridge 2. systemd-run gets a connection to the "foobar" container's system bus, and invokes the "systemd-stdio-bridge" binary as transient service inside a PAM session for the user "lennart" 3. The systemd-stdio-bridge then proxies our D-Bus traffic to the user bus. sd-bus (on host) → systemd-run (on host) → systemd-stdio-bridge (in container) Complicated? Well, to some point yes, but otoh it's actually nice in various other ways, primarily as it makes the -H and -M codepaths more alike. In the -H case (i.e. connect to remote host via SSH) a very similar three steps are used. The only difference is that instead of "systemd-run" the "ssh" binary is used to invoke the stdio bridge in a PAM session of some other system. Thus we get similar implementation and isolation for similar operations. Fixes: #14580