summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-02-21Merge pull request #5390 from keszybz/coverityLennart Poettering
Clarifications to make coverity happy
2017-02-20tree-wide: add man: to manpage references (#5402)Lucas Werkmeister
Found with: git grep '"[^"]*[a-z0-9]([0-9]\+p\?)' src/ | grep -vF man:
2017-02-20Syntax for defines that is also unterstood by the GNU C/C++ compilers. (#5397)pyBlob
2017-02-20systemctl: Fix condition in start_special() (#5399)Benjamin Robin
2017-02-20sd-device: replace lstat() + open() with open(O_NOFOLLOW)Zbigniew Jędrzejewski-Szmek
Coverity was complaining about TOCTOU (CID #745806). Indeed, it seems better to open the file and avoid the stat altogether: - O_NOFOLLOW means we'll get ELOOP, which we can translate to EINVAL as before, - similarly, open(O_WRONLY) on a directory will fail with EISDIR, - and finally, it makes no sense to check access mode ourselves: just let the kernel do it and propagate the error. v2: - fix memleak, don't clober input arg
2017-02-20shared/pager: abort if we cannot set environment variablesZbigniew Jędrzejewski-Szmek
This most likely means oom, it's better to exit than to run less with incomplete settings. CID #714383.
2017-02-20core/execute: add (void)Zbigniew Jędrzejewski-Szmek
CID #778045.
2017-02-20logind: check return value from lseekZbigniew Jędrzejewski-Szmek
In practice this doesn't matter much because the read that follows will likely fail, but we'll get a better error message. CID #1368233.
2017-02-20importd: check setenv return valueZbigniew Jędrzejewski-Szmek
CID #1368235.
2017-02-20core/killall: add (void)Zbigniew Jędrzejewski-Szmek
CID #1368238.
2017-02-20firewall-util: add an assert that we're not overwriting a bufferZbigniew Jędrzejewski-Szmek
Check for CID #1368267.
2017-02-20Merge pull request #5392 from keszybz/systemctl-editLennart Poettering
systemctl edit & reboot fixlets
2017-02-20Include 'vendor class identifier option' into DHCPREQUEST message (#5380)Alexander Galanin
2017-02-19systemctl: give a hint about --force --force when communication with manager ↵Zbigniew Jędrzejewski-Szmek
fails The hint is not too explicit, and just refers to the man page, because this option is slightly dangereous. This was we don't have to discuss the limitation in the hint itself. Fixes #4002.
2017-02-19systemctl: fix hint with edit --global/--userZbigniew Jędrzejewski-Szmek
2017-02-19systemctl: fix editing of units with no fragmentZbigniew Jędrzejewski-Szmek
"systemctl --user edit --force --full tmp.mount" would crash, when we'd do basename(NULL). Fix this by creating a new unit or a new override even if not path is found. Tested with: systemctl --user edit --force --full tmp.mount systemctl --user edit --force tmp.mount systemctl --user edit foo@.service systemctl --user edit foo@bar.service systemctl --user edit --full foo@.service systemctl --user edit --full foo@bar.service
2017-02-19systemctl: when told to edit an instance, do not edit the templateZbigniew Jędrzejewski-Szmek
Fixes #5383.
2017-02-19systemctl: fix error messages (#5389)Lucas Werkmeister
2017-02-19test: re-drop assumption that /run is a mount point, part 2 (#5386)Martin Pitt
Commit cc3901613 only fixed one place, fix the other one too.
2017-02-19udev-builtin-net_id: fix warning about discarded "const" attribute (#5385)Zbigniew Jędrzejewski-Szmek
2017-02-18journalctl: add reference to sd-id128(3) to output (#5382)Lucas Werkmeister
SD_ID128_MAKE is clearly not a standard C macro, so let’s point the user to its documentation to let them know which header they need and what they can then do with MESSAGE_XYZ.
2017-02-18man: sd-id128: fix journalctl option name (#5381)Lucas Werkmeister
--new-id works because it’s an unambiguous prefix, but the full option name is --new-id128.
2017-02-18Merge pull request #5369 from poettering/nspawn-resolvedZbigniew Jędrzejewski-Szmek
fixes for running nspawn+resolved in combination
2017-02-17units: order systemd-nspawn@.service after systemd-resolved.serviceLennart Poettering
This way, the nspawn internal check whether resolved is running will succeed if it is enabled. Fixes: #4649
2017-02-17nspawn: tweak check whether resolved is around a bitLennart Poettering
Let's check D-Bus instead of files in /run to see if resolved is running. This is a bit nicer as bus names are automatically cleaned up when resolved dies, which is not the case for files in /run. See: #4649
2017-02-17units: enable resolved bus activation though a symlink in /etcLennart Poettering
The change: -/usr/lib/systemd/system/dbus-org.freedesktop.resolve1.service +/etc/systemd/system/dbus-org.freedesktop.resolve1.service If resolved is disabled, without this, talking to the resolved bus API will activate it regardless whether it is enabled or not, let's fix that.
2017-02-17test: re-drop assumption that /run is a mount point (#5377)Martin Pitt
Commit 436e916ea introduced the assumption into test-stat-util that /run is a tmpfs mount point. This is not the case in build chroots such as Fedora's mock or Debian's sbuild. So only assert that /run is a tmpfs and not a btrfs if /run is actually a mount point. This will then still be asserted with installed tests.
2017-02-17systemctl: show extra args if defined (#5379)Adrián López
2017-02-17Merge pull request #5373 from poettering/coredump-timestamp-fixesZbigniew Jędrzejewski-Szmek
various coredump fixes
2017-02-17Merge pull request #5347 from poettering/local-ntaZbigniew Jędrzejewski-Szmek
more resolved fixes
2017-02-17missing: add renameat2() definition for 64bit arm (#5378)Lennart Poettering
Following a similar commit in casync: https://github.com/systemd/casync/pull/10
2017-02-17Merge pull request #5275 from ssahani/fix-dropin-net-sectionLennart Poettering
networkd: fix drop-in conf directory configs overwriting each other
2017-02-17udev: fix id_net_name_path for virtio-ccw interfaces (#5357)Viktor Mihajlovski
The CCW id_net_name_path detection didn't account for virtio interfaces on the CCW bus. As a result the default interface names for virtio-ccw interfaces would use the old eth<x> format instead of enc<busid>. Since virtio-pci interface naming follows the naming rules of the parent bus, the names_ccw() logic was changed to apply the CCW interface naming rules to virtio interfaces as well, e.g. enc2000 for an interface with a CCW bus id 0.0.2000. As virtio interfaces are apt to get the otherwise unusual CCW bus id 0.0.0000, the last '0' is now preserved in this case. The virtio subsystem skipping loop has been moved from names_pci() into a function skip_virtio() that can be reused for all bus types with virtio network devices. Since virtio-ccw interfaces use single CCW addresses the ccwgroup requirement was relaxed and the C definitions were changed accordingly.
2017-02-17network: change condition in if testing section presenceZbigniew Jędrzejewski-Szmek
section_line and filename should be set together or not at all. Change the if to test filename, since it's the first of the pair and it seems more natural to test that.
2017-02-17networkd: immediately transfer ownership of route->sectionZbigniew Jędrzejewski-Szmek
The code was not incorrect previously, but I think it's easier to follow the ownership (and the code is more likely to remain correct when updated later on), if freeing of NetworkConfigSection* is immediately made the responsibility of route_free(), so instead of relying on route_free() not freeing ->section if adding to the network hashmap failed, make this freeing unconditional.
2017-02-17Merge pull request #5333 from poettering/machined-copy-files-usernsLennart Poettering
machined userns fixes
2017-02-17Merge pull request #5366 from poettering/default-hostname-fixLennart Poettering
fallback hostname fixes
2017-02-17man: document that user namespacing complicates file copiesLennart Poettering
2017-02-17coredump: store the full coredump kernel context in xattrs on the coredump fileLennart Poettering
We didn't include the resource limit field, add it.
2017-02-17coredump: when reconstructing original kernel coredump context, chop off ↵Lennart Poettering
trailing zeroes Our coredump handler operates on a "context" supplied by the kernel via the core_pattern arguments. When we pass off a coredump for processing to coredumpd we pass along enough information for this context to be reconstructed. This information is passed in the usual journal fields, and that means we extended the 1s granularity timestamp to 1µs granularity by appending 6 zeroes. We need to chop them off again when reconstructing the original kernel context. Fixes: #4779
2017-02-17udevd: use signal_to_string() instead of strsignal() at one placeLennart Poettering
strsignal() sucks, as it tries to generate human readable strings from something that isn't really human readable by concept. Let's use signal_to_string() instead, making this more grokkable. Difference is: SIGINT gets translated → "SIGINT" rather than → "Interrupted".
2017-02-17coredump: include signal name in journal metadataLennart Poettering
(Note that we only do this for the journal metadata, not for the xattrs, as the xattrs are only supposed to store the original 1:1 info we acquired from the kernel.)
2017-02-17coredump: fix handling of special crashesLennart Poettering
When we encounter a "special" crash we should not continue processing it the usual way.
2017-02-17resolved: try to authenticate SOA on negative repliesLennart Poettering
For caching negative replies we need the SOA TTL information. Hence, let's authenticate all auxiliary SOA RRs through DS requests on all negative requests.
2017-02-17resolved: extend various timeoutsLennart Poettering
Let's increase a number of timeouts as they apparently are too short for some real-world lookups. See: https://github.com/systemd/systemd/issues/4003#issuecomment-279842616 In particular we change the following timeouts: 1) The first UDP retry we increase 500ms → 750ms. This is a good idea, since some servers need relatively long responses for trivial lookups, and giving up our first attempt also has the effect of trying a different server for the next attempt which has the side effect that we'll run two down-grade iterations in parallel, on both servers. Hence, let's give servers a bit more time in the first iteration. 2) Permit 24 retries instead of just 16 per transactions. If we end up downgrading all the way down to UDP for a lookup we already need 5 iterations for that. If we want permit a couple of lost packages for each (let's say 4), then we already need 20 iterations. 3) Increase the overall query timeout on the service side to 60s (from 45s), simply because very long and slow DNSSEC + CNAME chains (such as us.ynuf.alipay.com) hit this boundary too easily. The client side timeout for the bus method call is increased to 90s, in order to have room for the dbus reply to go through
2017-02-17resolved: initialize all return values on successful exit of dns_cache_lookup()Lennart Poettering
Following our coding style on success we should initialize all return parameters of a function. We missed to cases for dns_cache_lookup() (but covered all others), fix them too.
2017-02-17resolved: show rcode in debug output for incoming repliesLennart Poettering
This is the most important piece of information of replies, hence show this in the first log message about it. (Wireshark shows it too in the short summary, hence this definitely makes sense...)
2017-02-17resolved: don't downgrade feature level if we get RCODE on UDP levelLennart Poettering
Retrying a transaction via TCP is a good approach for mitigating packet loss. However, it's not a good away way to fix a bad RCODE if we already downgraded to UDP level for it. Hence, don't do this. This is a small tweak only, but shortens the time we spend on downgrading when a specific domain continously returns a bad rcode.
2017-02-17resolved: cache SERVFAIL responses for 30sLennart Poettering
Some domains (such as us.ynuf.alipay.com) almost appear as if they actively want to sabotage our DNSSEC work. Specifically, they unconditionally return SERVFAIL on SOA lookups and always only after a 1s delay (at least). This is pretty bad for our validation logic, as we use SOA lookups to distuingish zones from non-terminal names. Moreover, SERVFAIL is an error that is typically returned if we send requests a server doesn't grok, and thus is reason for us to downgrade our protocol and try again. In case of these zones this means we'll accept the SERVFAIL response only after a full iterative downgrade to our lowest feature level: TCP. In combination with the 1s delays this has the effect of making us hit our transaction timeout way to easily. As first attempt to improve the situation: let's start caching SERVFAIL responses in our cache, after the full downgrade for a short period of time. Conceptually this is exposed as "weird rcode" caching, but for now we only consider SERVFAIL a "weird rcode" worthy of caching. Later on we might want to add more.
2017-02-17resolved: lengthen timeout for TCP transactionsLennart Poettering
When we are doing a TCP transaction the kernel will automatically resend all packets for us, there's no need to do that ourselves. Hence: increase the timeout for TCP transactions substantially, to give the kernel enough time to connect to the peer, without interrupting it when we become impatient.