aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* udev-event: do not read stdout or stderr if the pipefd is not createdHEADmasterYu Watanabe2018-12-281-6/+10
| | | | Fixes #11255.
* switch-root: fix error messageYu Watanabe2018-12-281-1/+1
| | | | Fixes #11261.
* core: free lines after reading themEvgeny Vereshchagin2018-12-281-1/+1
| | | | Closes https://github.com/systemd/systemd/issues/11251.
* Do not start server if it is already runnning (#11245)rogerjames992018-12-281-7/+8
|
* meson: use cross compilation compatible c++ checkJames Hilliard2018-12-283-6/+3
|
* core: support %j in unit dependency resolutionPatrick Williams2018-12-223-0/+78
| | | | | | | | | | | | | | Commit 250e9fadbcc0ca90e697d7efb40855b054ed3b8f introduced support for %j/%J specifier in unit files. The function unit_name_printf is used in unit dependency resolution, such as Wants / After directives, but was missing support for the %j. Add to allow directives such as: [Unit] Wants=bar-%j.target Fixes: systemd/systemd#11217 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* NEWS: add one more name and adjust locationv240Zbigniew Jędrzejewski-Szmek2018-12-211-38/+38
|
* Merge pull request #11239 from poettering/news-v240-finalZbigniew Jędrzejewski-Szmek2018-12-212-33/+34
|\ | | | | NEWS and build system bump for 240
| * NEWS: prepare for v240Lennart Poettering2018-12-211-30/+31
| |
| * build-sys: bump package/library versionsLennart Poettering2018-12-211-3/+3
| |
* | tree-wide: use assert_se() for signal operations with constantsZbigniew Jędrzejewski-Szmek2018-12-214-19/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuation of a3ebe5eb620e49f0d24082876cafc7579261e64f: in other places we sometimes use assert_se(), and sometimes normal error handling. sigfillset and sigaddset can only fail if mask is NULL (which cannot happen if we are passing in a reference), or if the signal number is invalid (which really shouldn't happen when we are using a constant like SIGCHLD. If SIGCHLD is invalid, we have a bigger problem). So let's simplify things and always use assert_se() in those cases. In sigset_add_many() we could conceivably pass an invalid signal, so let's keep normal error handling here. The caller can do assert_se() around the sigprocmask_many() call if appropriate. '>= 0' is used for consistency with the rest of the codebase.
* | Merge pull request #11206 from cdown/cgroup_no_v1Zbigniew Jędrzejewski-Szmek2018-12-213-3/+27
|\ \ | | | | | | cgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=all
| * | cgroup: Add NEWS entry for cgroup_no_v1=all implying unified usageChris Down2018-12-211-0/+4
| | |
| * | cgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=allChris Down2018-12-212-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cgroup_no_v1=all doesn't make a whole lot of sense with legacy hierarchy (where we use v1 hierarchy for everything), or hybrid hierarchy (where we still use v1 hierarchy for resource control). Right now we have to tell people to add both cgroup_no_v1=all and systemd.unified_cgroup_hierarchy=1 to get the desired behaviour, however in reality it's hard to imagine any situation where someone passes cgroup_no_v1=all but *doesn't* want to use the unified cgroup hierarchy. Make it so that cgroup_no_v1=all produces intuitive behaviour in systemd by default, although it can still be disabled by passing systemd.unified_cgroup_hierarchy=0 explicitly.
* | | sd-device: ignore bind/unbind events for nowDmitry Torokhov2018-12-211-0/+9
| | | | | | | | | | | | | | | Until systemd/udev are ready for the new events and do not flush entire device state on each new event received, we should ignore them.
* | | Revert "sleep: offer hibernation only if the kernel image still exists"Zbigniew Jędrzejewski-Szmek2018-12-213-83/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit edda44605f06a41fb86b7ab8128dcf99161d2344. The kernel explicitly supports resuming with a different kernel than the one used before hibernation. If this is something that shouldn't be supported, the place to change this is in the kernel. We shouldn't censor something that this exclusively in the kernel's domain. People might be using this to switch kernels without restaring programs, and we'd break this functionality for them. Also, even if resuming with a different kernel was a bad idea, we don't really prevent that with this check, since most users have more than one kernel and can freely pick a different one from the menu. So this only affected the corner case where the kernel has been removed, but there is no reason to single it out.
* | | Merge pull request #11050 from poettering/resolved-domain-routeLennart Poettering2018-12-2123-116/+470
|\ \ \ | | | | | | | | resolved: beef up domain routing
| * | | man: document new systemd-resolved.service(8) routing features in more detailLennart Poettering2018-12-211-7/+36
| | | |
| * | | man: split long section in systemd-resolved.service man page into threeLennart Poettering2018-12-211-4/+15
| | | | | | | | | | | | | | | | Also, do some minor updating.
| * | | resolved: read DNS default route option from networkdLennart Poettering2018-12-211-0/+25
| | | |
| * | | sd-network: add new API sd_network_link_get_dns_default_route()Lennart Poettering2018-12-212-0/+22
| | | | | | | | | | | | | | | | | | | | This simply reads from networkd's state files whether a link shall be used as DNS default route.
| * | | networkd: permit DNS "DefaultRoute" configuration in .network filesLennart Poettering2018-12-216-4/+22
| | | |
| * | | networkd: small simplificationLennart Poettering2018-12-211-8/+4
| | | |
| * | | resolvectl: add support for reading/writing per-link 'default-route' booleanLennart Poettering2018-12-212-10/+75
| | | |
| * | | resolvectl: minor whitespace fixLennart Poettering2018-12-211-1/+1
| | | |
| * | | resolved: add bus API to set per-link "default route" booleanLennart Poettering2018-12-213-0/+58
| | | |
| * | | resolved: add an explicit way to configure whether a link is useful as ↵Lennart Poettering2018-12-215-23/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default route Previously, we'd use a link as "default" route depending on whether there are route-only domains defined on it or not. (If there are, it would not be used as default route, if there aren't it would.) Let's make this explicit and add a link variable controlling this. The variable is not changeable from the outside yet, but subsequent commits are supposed to add that. Note that making this configurable adds a certain amount of redundancy, as there are now two ways to ensure a link does not receive "default" lookup (i.e. DNS queries matching no configured route): 1. By ensuring that at least one other link configures a route on it (for example by add "." to its search list) 2. By setting this new boolean to false. But this is exactly what is intended with this patch: that there is an explicit way to configure on the link itself whether it receives 'default' traffic, rather than require this to be configured on other links. The variable added is a tri-state: if true, the link is suitable for recieving "default" traffic. If false, the link is not suitable for it. If unset (i.e. negative) the original logic of "has this route-only routes" is used, to ensure compatibility with the status quo ante.
| * | | resolved: rework dns_server_limited_domains(), replace by ↵Lennart Poettering2018-12-215-34/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dns_scope_has_route_only_domains() The function dns_server_limited_domains() was very strange as it enumerate the domains associated with a DnsScope object to determine whether any "route-only" domains, but did so as a function associated with a DnsServer object. Let's clear this up, and replace it by a function associated with a DnsScope instead. This makes more sense philosphically and allows us to reduce the loops through which we need to jump to determine whether a scope is suitable for default routing a bit.
| * | | resolved: bind .local domains to mDNS with DNS_SCOPE_YES, similar LLMNRLennart Poettering2018-12-212-9/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we'd return DNS_SCOPE_MAYBE for all domain lookups matching LLMNR or mDNS. Let's upgrade this to DNS_SCOPE_YES, to make the binding stronger. The effect of this is that even if "local" is defined as routing domain on some iface, we'll still lookup domains in local via mDNS — if mDNS is turned on. This should not be limiting, as people who don't want such lookups should turn off mDNS altogether, as it is useless if nothing is routed to it. This also has the nice benefit that mDNS/LLMR continue to work if people use "~." as routing domain on some interface. Similar for LLMNR and single label names. Similar also for the link local IPv4 and IPv6 reverse lookups. Fixes: #10125
| * | | resolved: rework how we determine which scope to send a query toLennart Poettering2018-12-213-20/+47
| | | | | | | | | | | | | | | | Fixes: #10830 #9825 #9472
| * | | resolved: add comment, explaining when Scope variables are copied from LinkLennart Poettering2018-12-211-0/+2
| | | |
| * | | resolved: rename_DNS_SCOPE_INVALID → _DNS_SCOPE_MATCH_INVALIDLennart Poettering2018-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | The _INVALID and _MAX enum fields should always use the full name of thenum.
| * | | resolved: check dns_over_tls_mode in link_needs_save()Lennart Poettering2018-12-211-1/+2
| | | | | | | | | | | | | | | | This was forgotten when DoT was added.
| * | | resolved: use structured initialization for DnsScopeLennart Poettering2018-12-211-6/+8
| | |/ | |/|
* | | Merge pull request #11210 from thom311/dhcp-set-client-id-no-invalLennart Poettering2018-12-214-22/+27
|\ \ \ | | | | | | | | dhcp: don't enforce hardware address length for sd_dhcp_client_set_client_id()
| * | | dhcp6: don't enforce DUID content for sd_dhcp6_client_set_duid()Thomas Haller2018-12-204-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are various functions to set the DUID of a DHCPv6 client. However, none of them allows to set arbitrary data. The closest is sd_dhcp6_client_set_duid(), which would still do validation of the DUID's content via dhcp_validate_duid_len(). Relax the validation and only log a debug message if the DUID does not validate. Note that dhcp_validate_duid_len() already is not very strict. For example with DUID_TYPE_LLT it only ensures that the length is suitable to contain hwtype and time. It does not further check that the length of hwaddr is non-zero or suitable for hwtype. Also, non-well-known DUID types are accepted for extensibility. Why reject certain DUIDs but allowing clearly wrong formats otherwise? The validation and failure should happen earlier, when accepting the unsuitable DUID. At that point, there is more context of what is wrong, and a better failure reason (or warning) can be reported to the user. Rejecting the DUID when setting up the DHCPv6 client seems not optimal, in particular because the DHCPv6 client does not care about actual content of the DUID and treats it as opaque blob. Also, NetworkManager (which uses this code) allows to configure the entire binary DUID in binary. It intentionally does not validate the binary content any further. Hence, it needs to be able to set _invalid_ DUIDs, provided that some basic constraints are satisfied (like the maximum length). sd_dhcp6_client_set_duid() has two callers: both set the DUID obtained from link_get_duid(), which comes from configuration. `man networkd.conf` says: "The configured DHCP DUID should conform to the specification in RFC 3315, RFC 6355.". It does not not state that it MUST conform. Note that dhcp_validate_duid_len() has another caller: DHCPv4's dhcp_client_set_iaid_duid_internal(). In this case, continue with strict validation, as the callers are more controlled. Also, there is already sd_dhcp_client_set_client_id() which can be used to bypass this check and set arbitrary client identifiers.
| * | | dhcp: don't enforce hardware address length for sd_dhcp_client_set_client_id()Thomas Haller2018-12-201-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sd_dhcp_client_set_client_id() is the only API for setting a raw client-id. All other setters are more restricted and only allow to set a type 255 DUID. Also, dhcp4_set_client_identifier() is the only caller, which already does: r = sd_dhcp_client_set_client_id(link->dhcp_client, ARPHRD_ETHER, (const uint8_t *) &link->mac, sizeof(link->mac)); and hence ensures that the data length is indeed ETH_ALEN. Drop additional input validation from sd_dhcp_client_set_client_id(). The client-id is an opaque blob, and if a caller wishes to set type 1 (ethernet) or type 32 (infiniband) with unexpected address length, it should be allowed. The actual client-id is not relevant to the DHCP client, and it's the responsibility of the caller to generate a suitable client-id. For example, in NetworkManager you can configure all the bytes of the client-id, including such _invalid_ settings. I think it makes sense, to allow the user to fully configure the identifier. Even if such configuration would be rejected, it would be the responsibility of the higher layers (including a sensible error message to the user) and not fail later during sd_dhcp_client_set_client_id(). Still log a debug message if the length is unexpected.
| * | | dhcp: fix sd_dhcp_client_set_client_id() for infiniband addressesThomas Haller2018-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Infiniband addresses are 20 bytes (INFINIBAND_ALEN), but only the last 8 bytes are suitable for putting into the client-id. This bug had no effect for networkd, because sd_dhcp_client_set_client_id() has only one caller which always uses ARPHRD_ETHER type. I was unable to find good references for why this is correct ([1]). Fedora/RHEL has patches for ISC dhclient that also only use the last 8 bytes ([2], [3]). RFC 4390 (Dynamic Host Configuration Protocol (DHCP) over InfiniBand) [4] does not discuss the content of the client-id either. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1658057#c29 [2] https://bugzilla.redhat.com/show_bug.cgi?id=660681 [3] https://src.fedoraproject.org/rpms/dhcp/blob/3ccf3c8d815df4b8e11e1a04850975f099273d5d/f/dhcp-lpf-ib.patch [4] https://tools.ietf.org/html/rfc4390
* | | | tree-wide: make new/new0/malloc_multiply/reallocarray safe for size 0Zbigniew Jędrzejewski-Szmek2018-12-212-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All underlying glibc calls are free to return NULL if the size argument is 0. We most often call those functions with a fixed argument, or at least something which obviously cannot be zero, but it's too easy to forget. E.g. coverity complains about "rows = new0(JsonVariant*, n_rows-1);" in format-table.c There is an assert that n_rows > 0, so we could hit this corner case here. Let's simplify callers and make those functions "safe". CID #1397035. The compiler is mostly able to optimize this away: $ size build{,-opt}/src/shared/libsystemd-shared-239.so (before) text data bss dec hex filename 2643329 580940 3112 3227381 313ef5 build/src/shared/libsystemd-shared-239.so (-O0 -g) 2170013 578588 3089 2751690 29fcca build-opt/src/shared/libsystemd-shared-239.so (-03 -flto -g) (after) text data bss dec hex filename 2644017 580940 3112 3228069 3141a5 build/src/shared/libsystemd-shared-239.so 2170765 578588 3057 2752410 29ff9a build-opt/src/shared/libsystemd-shared-239.so
* | | | analyze: add assert to verify we are not dividing by 0Zbigniew Jędrzejewski-Szmek2018-12-211-0/+1
| | | | | | | | | | | | | | | | CID #1397051.
* | | | udevadm: add two more assertionsYu Watanabe2018-12-211-2/+2
| |/ / |/| | | | | | | | | | | | | | Suggested by Coverity. Closes CID#1397033 and CID#1395708.
* | | hwdb: update databaseZbigniew Jędrzejewski-Szmek2018-12-2112-3080/+18273
| | | | | | | | | | | | | | | | | | I looked over the diff, and it seems it's only additions and fixes, no removals. The diff for the source files is much bigger, but it seems that the sorting code is working well.
* | | NEWS: mention DynamicUser= is disabled for networkd, resolved and timesyncdYu Watanabe2018-12-211-0/+9
| | | | | | | | | | | | Which was disabled by #10117.
* | | tests: explicitly enable user namespaces for TEST-13-NSPAWN-SMOKEFrantisek Sumsal2018-12-211-1/+6
| | |
* | | hwdb: Add accelerometer orientation quirk for the PoV TAB-P1006W-232-3GHans de Goede2018-12-201-0/+4
| | | | | | | | | | | | | | | Add accelerometer orientation quirk for the Point of View TAB-P1006W-232-3G tablet.
* | | Merge pull request #11223 from poettering/read-line-0x00-0xffLennart Poettering2018-12-202-9/+16
|\ \ \ | | | | | | | | fileio: fix read_one_line() when reading bytes > 0x7F
| * | | test-fileio: add explicit check for safe_fgetc() with 0xFFLennart Poettering2018-12-201-4/+5
| | | |
| * | | fileio: fix read_one_line() when reading bytes > 0x7FLennart Poettering2018-12-202-5/+11
| | | | | | | | | | | | | | | | Fixes: #11218
* | | | hwdb: Add support for HP ProBook 645 wifi and slash key (#11207)Jeremy Su2018-12-201-0/+5
| | | | | | | | | | | | hwdb: Add support for HP ProBook 645 wifi and slash key
* | | | Merge pull request #11222 from keszybz/tmpfiles-crashLennart Poettering2018-12-202-9/+73
|\ \ \ \ | |/ / / |/| | | tmpfiles: fix crash with NULL in arg_root and other fixes and tests