summaryrefslogtreecommitdiffstats
path: root/LICENSE.GPL2 (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-12-14networkd: RouteTable option in [IPv6AcceptRA] is now properly processed (#7633)Saran Tunyasuvunakool1-1/+1
Fixes: #7632
2017-12-14resolved: fix "in-between" logic when boundaries are equal (#7590)Lennart Poettering2-10/+14
This changes dns_name_between() to deal properly with checking whether B is between A and C if A and C are equal. Previously we simply returned -EINVAL in this case, refusing checking. With this change we correct behaviour: if A and C are equal, then B is "between" both if it is different from them. That's logical, since we do < and > comparisons, not <= and >=, and that means that anything "right of A" and "left of C" lies in between with wrap-around at the ends. And if A and C are equal that means everything lies between, except for A itself. This fixes handling of domains using NSEC3 "white lies", for example the .it TLD. Fixes: #7421
2017-12-14man: systemd.unit: move note about clearing lists (#7621)Daniel Black1-8/+6
This is mainly for drop-in files.
2017-12-13sysctl: disable buffer while writing to /procTiago Salem Herrmann3-1/+5
fputs() writes only first 2048 bytes and fails to write to /proc when values are larger than that. This patch adds a new flag to WriteStringFileFlags that make it possible to disable the buffer under specific cases.
2017-12-13Use read_line() and LONG_LINE_MAX to read values configuration files.Tiago Salem Herrmann1-7/+7
2017-12-13networkd/dhcp: shorten overlong hostname (#7616)Luca Bruno4-3/+96
This commit updates networkd behavior to check if the hostname option received via DHCP is too long for Linux limit, and in case shorten it. An overlong hostname will be truncated to the first dot or to `HOST_MAX_LEN`, whatever comes earlier.
2017-12-13catalog: don't say "systemd" when we mean "system"Lennart Poettering1-1/+1
Yeah, it's hard to type "system", if all you ever type is "systemd", but it's still a typo in this case.
2017-12-13man: "systemd" is to be written in all lower-case, even at beginnings of ↵Lennart Poettering9-11/+11
sentences This very important commit is very important.
2017-12-13tree-wide: use STRLEN() to allocate buffer of constant sizeThomas Haller2-2/+2
Using strlen() to declare a buffer results in a variable-length array, even if the compiler likely optimizes it to be a compile time constant. When building with -Wvla, certain versions of gcc complain about such buffers. Compiling with -Wvla has the advantage of preventing variably length array, which defeat static asserts that are implemented by declaring an array of negative length.
2017-12-13basic/macros: add STRLEN() to get length of string literal as constant ↵Thomas Haller1-0/+8
expression While the compiler likely optimizes strlen(x) for string literals, it is not a constant expression. Hence, char buffer[strlen("OPTION_000") + 1]; declares a variable-length array. STRLEN() can be used instead when a constant espression is needed. It's not entirely identical to strlen(), as STRLEN("a\0") counts 2. Also, it only works with string literals and the macro enforces that the argument is a literal.
2017-12-13networkd: don't try to configure IPv6 proxy NDP if IPv6 is not available (#7613)Lennart Poettering1-1/+7
Fixes: #7612
2017-12-12cryptsetup: use more descriptive name for the variable and drop redundant ↵Michal Sekletar1-32/+7
function Let's rename escaped_name to disk_path since this is an actual content that pointer refers to. It is either path to encrypted block device or path to encrypted image file. Also drop redundant function disk_major_minor(). src is always set, and it always points to either encrypted block device path (or symlink to such device) or to encrypted image. In case it is set to device path there is no need to reset it to /dev/block/major:minor symlink since those paths are equivalent.
2017-12-12meson: link NSS modules with -z nodelete (#7607)Lennart Poettering1-1/+3
We might end up allocating mempools, and when we are unloaded we might orphan them, thus leaking them. Hence, let's just stick around for good, so the mempools remain referenced continously and for good, and thus no memory is leaked (though the memory isn't cleaned up either). Fixes: #7596
2017-12-12cryptsetup: when unlocking always put path to the object into IdMichal Sekletar1-1/+1
Some ask-password agents (e.g. clevis-luks-askpass) use Id option from /run/systemd/ask-password/ask* file in order to obtain the password for the device. Id option should be in the following format, e.g. Id=subsystem:data. Where data part is supposed to identify object that ask-password query is done for. Since e51b9486d1b59e72c293028fed1384f4e4ef09aa this field has format Id=cryptsetup:/dev/block/major:minor when systemd-cryptsetup is unlocking encrypted block device. However, crypttab also supports encrypted image files in which case we usually set data part of Id to "vol on mountpoint". This is unexpected and actually breaks network based device encryption as implemented by clevis. Example: $ cat /etc/crypttab clevis-unlocked /clevis-test-disk-image none luks,_netdev $ systemctl start 'systemd-cryptsetup@clevis\x2dunlocked.service' $ grep Id /run/systemd/ask-password/ask* Before: $ Id=cryptsetup:clevis-unlocked on /clevis-test-disk-image-mnt After: $ Id=cryptsetup:/clevis-test-disk-image
2017-12-12resolve: add support for RFC 8080 (#7600)ott5-38/+378
RFC 8080 describes how to use EdDSA keys and signatures in DNSSEC. It uses the curves Ed25519 and Ed448. Libgcrypt 1.8.1 does not support Ed448, so only the Ed25519 is supported at the moment. Once Libgcrypt supports Ed448, support for it can be trivially added to resolve.
2017-12-12networkd: Fix race condition in [RoutingPolicyRule] handling (#7615)Saran Tunyasuvunakool3-27/+43
The routing policy rule setup logic is moved to the routes setup phase (rather than the addresses setup phase as it is now). Additionally, a call to `link_check_ready` is added to the routing policy rules setup handler. This prevents a race condition with the routes setup handler. Also give each async handler its own message counter to prevent race conditions when logging successes. Fixes: #7614
2017-12-12resolved: try a different server if server is too dumb to do DNSSECLennart Poettering1-2/+11
If we are in strict DNSSEC mode it's worthy to try a different DNS server before accepting that DNSSEC is not actually supported. Fixes: #7040
2017-12-12resolved: cast dns_scope_get_dns_server() to NULL when we ignore itLennart Poettering1-1/+1
2017-12-12resolved: when a server consistently returns SERVFAIL, try another oneLennart Poettering4-1/+35
Currently, we accept SERVFAIL after downgrading fully, cache it and move on. Let's extend this a bit: after downgrading fully, if the SERVFAIL logic continues to be an issue, then use a different DNS server if there are any. Fixes: #7147
2017-12-11verbs: add a new VERB_MUSTBEROOT flagLennart Poettering4-23/+21
Given that we regularly have verbs that require privileges, let's just make this a flag of the verb.
2017-12-11tree-wide: unify logging of "Must be root" messageLennart Poettering7-27/+25
Let's unify this in one call, generalizing must_be_root() from bootctl.c.
2017-12-11bootspec: sprinkle some argument assert()s all over the placeLennart Poettering1-5/+29
The previous commit fixed a NULL parameter issue, let's check for such, to make it easier to find issues like this.
2017-12-11bootctl: don't trip up in "bootctl status" when we can't find the ESP ↵Lennart Poettering1-6/+10
because of lack of privilges On my system the boot and EFI partitions are protected, hence "bootctl status" can't find the ESP, and then the tool continues with arg_path == NULL, which it really should not. Handle these cases, and simply suppress all output that needs arg_path.
2017-12-11efi: rework find_esp() error propagation/logging a bitLennart Poettering4-47/+95
This renames find_esp() to find_esp_and_warn() and tries to normalize its behaviour: 1. Change the error that is returned when we can't find the ESP to ENOKEY (from ENOENT). This way the error code can only mean one thing: that our search loop didn't find a good candidate. 2. Really log about all errors, except for ENOKEY and EACCES, and document the letter cases. 3. Normalize parameters to the call: separate out the path parameter in two: an input path and an output path. That way the memory management is clear: we will access the input parameter only for reading, and only write out the output parameter, using malloc() memory. Before the calling convention were quire surprising for internal API code, as the path parameter had to be malloc() memory and might and might not have changed. 4. Rename bootctl's find_esp_warn() to acquire_esp(), and make it a simple wrapper around find_esp_warn(), that basically just adds the friendly logging for the ENOKEY case. This rework removes double logging in a number of error cases, as we no longer log here in anything but ENOKEY, and leave that entirely to find_esp_warn(). 5. find_esp_and_warn() now takes a bool flag parameter "unprivileged_mode", which disables logging in the EACCES case, and skips privileged validation of the path. This makes the function less magic, and doesn't hide this internal silencing automatism from the caller anymore. With all that in place "bootctl list" and "bootctl status" work properly (or as good as they can) when I invoke the tools whithout privileges on my system where /boot is not world-readable
2017-12-11NEWS: more updates for v236Lennart Poettering1-23/+51
2017-12-11mailmap: add more names from the v236 cycleLennart Poettering1-0/+9
Let's clean up after github's "squash" feature…
2017-12-11tree-wide: drop a few == NULL and != NULL comparisonLennart Poettering15-23/+37
Our CODING_STYLE suggests not comparing with NULL, but relying on C's downgrade-to-bool feature for that. Fix up some code to match these guidelines. (This is not comprehensive, the coccinelle output for this is unfortunately kinda borked)
2017-12-10resolved: fix wrong error code (#7601)Yu Watanabe1-2/+2
2017-12-10core: fix undefined behaviour due to uninitialized string buffer (#7597)Alan Jenkins1-0/+1
Failure of systemd to respond on the bus interface was bisected to af6b0ecc "core: make "taint" string logic a bit more generic and output it at boot". Failure was presumably caused by trying to append strings to an unintialized buffer, leading to writing outside the unterminated buffer and hence undefined behaviour.
2017-12-08virt: use XENFEAT_dom0 to detect the hardware domain (#6442, #6662) (#7581)Olaf Hering1-0/+20
The detection of ConditionVirtualisation= relies on the presence of /proc/xen/capabilities. If the file exists and contains the string "control_d", the running system is a dom0 and VIRTUALIZATION_NONE should be set. In case /proc/xen exists, or some sysfs files indicate "xen", VIRTUALIZATION_XEN should be set to indicate the system is a domU. With an (old) xenlinux based kernel, /proc/xen/capabilities is always available and the detection described above works always. But with a pvops based kernel, xenfs must be mounted on /proc/xen to get "capabilities". This is done by a proc-xen.mount unit, which is part of xen.git. Since the mounting happens "late", other units may be scheduled before "proc-xen.mount". If these other units make use of "ConditionVirtualisation=", the virtualization detection returns incorect results. detect_vm() will set VIRTUALIZATION_XEN because "xen" is found in sysfs. This value will be cached. Once xenfs is mounted, the next process that runs detect_vm() will get VIRTUALIZATION_NONE. This misdetection can be fixed by using /sys/hypervisor/properties/features, which exports the value returned by the "XENVER_get_features" hypercall. If the bit XENFEAT_dom0 is set, the domain is the "hardware domain". It is supposed to have permissions to access all hardware. The used sysfs file is available since v2.6.31. The commonly used term "dom0" refers to the control domain which runs the toolstack and has access to all hardware. But the virtualization host may be configured such that one dedicated domain becomes the "hardware domain", and another one the "toolstack domain".
2017-12-08documentation: add description for watchdog device pathEdward A. James2-2/+22
Document the command line parameter and the system configuration file setting.
2017-12-08core: Add WatchdogDevice config option and implement itEdward A. James2-2/+41
This option allows a device path to be specified for the systemd watchdog (both runtime and shutdown). If a system requires a watchdog other than /dev/watchdog (pointing to /dev/watchdog0) to be used to reboot the system, this setting should be changed to the relevant watchdog device path (e.g. /dev/watchdog1).
2017-12-08watchdog: allow a device path to be specifiedEdward A. James2-1/+13
Currently systemd hardcodes the use of /dev/watchdog. This is a legacy chardev that points to watchdog0 in the system. Modify the watchdog API to allow a different device path to be passed and stored. Opening the watchdog defaults to /dev/watchdog, maintaining existing behavior.
2017-12-08shared: use _cleanup_ in specifier_printf (#7586)Zbigniew Jędrzejewski-Szmek1-15/+10
Follow-up for e62d316561.
2017-12-08resolved: tweak domain routing logic a bitLennart Poettering1-17/+20
This makes sure that a classic DNS scope that has no DNS servers assigned is never considered for routing requests to even if it has matching search/routing domains associated. This is inspired by #7544, where lookup requests are refused since a scope with no DNS server is configured. This change does not deliver what the reporter intended, but is generally useful in general, as it makes us mor robust to misconfiguration.
2017-12-08resolved: synchronize introduction blurbs in all three resolv.conf files we ↵Lennart Poettering2-12/+35
provide Let's use the same wording and same contents in all three versions.
2017-12-08resolved: beef up logic to detect our own configuration filesLennart Poettering1-12/+20
Let's also check for the static resolv.conf, so that we filter all three of our own files out.
2017-12-08resolved: don't make defines needlessly publicLennart Poettering2-3/+3
2017-12-08resolved: store the mtime of the file we readLennart Poettering1-4/+2
Let's make sure we use the mtime of the current fstat() data, rather than the mtime of the old stat(), fixing a theoretical race.
2017-12-08resolved: fix a minimal race, when reading /etc/resolv.confLennart Poettering1-11/+25
The user might replace a foreign /etc/resolv.conf with a symlink to one of ours between the time we did stat() and open the file. Hence, let's check the fstat() data right after opening the file, a second time.
2017-12-08man: normalize indentation in systemd.unit.xmlZbigniew Jędrzejewski-Szmek1-90/+89
2017-12-08man: add a table of setting inversesZbigniew Jędrzejewski-Szmek1-1/+107
It would be nicer to use <footnote> to place the notes directly in the table, but docbook renders this improperly. v2: - also add "RequiredBy=" to the notes section - remove duplicated paragraph v3: - clarify the description - drop References/ReferenceBy which are only shown in systemd-analyze dump
2017-12-08acl: fix typo in comment (#7580)Yu Watanabe1-1/+1
2017-12-08networkd: Ignore DNS information when uplink is not managed (#7571)Patrik Flykt1-0/+10
When another networking daemon or configuration is handling the uplink connection, systemd-networkd won't have a network configuration associated with the link, and therefore link->network will be NULL. An assert will be triggered later on in the code when link->network is NULL.
2017-12-08resolved: support multiple TXT RRs per DNS-SD serviceDmitry Rozhkov7-70/+183
Section 6.8 of RFC 6763 allows having service instances with multiple TXT resource records.
2017-12-08resolved: consult Polkit for privileges when manipulating DNS-SDDmitry Rozhkov6-3/+90
2017-12-08resolved: resolve possible conflicts for DNS-SD RRsDmitry Rozhkov3-17/+63
It might happen that a DNS-SD service doesn't include local host's name in its RR keys and still conflicts with a remote service. In this case try to resolve the conflict by changing name for this particular service.
2017-12-08resolved: don't check conflicts for DNS-SD enumeration RRsDmitry Rozhkov1-0/+4
2017-12-08resolved: add man page for systemd.dnssdDmitry Rozhkov3-0/+252
2017-12-08resolved: implement D-Bus API for DNS-SDDmitry Rozhkov9-0/+392