summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-02-21Merge pull request #2650 from vcaputo/async_fsyncLennart Poettering
Perform journal offlines asynchronously when possible
2016-02-21Merge pull request #2681 from keszybz/udev-rulesLennart Poettering
udev-rules cleanup and coverity warning silencing
2016-02-21udev-rules: use _cleanup_ for fcloseZbigniew Jędrzejewski-Szmek
2016-02-21udev-rules: make error messages about rules more uniformZbigniew Jędrzejewski-Szmek
Also downgrade non-fatal warnings to log_warning. Previously rule_add_key() would check the output array and log a cryptic error and return -1. Most of the time the return value was ignored. This does not seems right, because the buffer can overflow with enough rules. It would also check if we have enough space for the *next* rule, even if there might be not next rule, i.e. off-by-one. Replace this with a check that we have enough space for a next rule before we start parsing. Normally using macros to alter flow is not allowed, but in this case I think it is worth it, because it allows lots of boilerplate code to be removed and hides repeated boring parameters, making function logic much easier to follow.
2016-02-21udev-rules: rewrite function to avoid clobbering argumentsZbigniew Jędrzejewski-Szmek
If the attribute wasn't found, the last filename looked at was returned in the input/output argument. This just seems bad style. The return value was ignored, so change function to return void.
2016-02-21udev-rules: modernize syntax a bitZbigniew Jędrzejewski-Szmek
2016-02-21udev-rules: log_oom() on memory error and abort processing of eventZbigniew Jędrzejewski-Szmek
CID #1313566. Also, change the return value to void, because it is ignored anyway.
2016-02-20sd-device: use (void) before set_iterate callsZbigniew Jędrzejewski-Szmek
set_iterate sets the output argument to NULL on error, and the return value is not used in this case. CID #1306804-09.
2016-02-20time-util: check for overflow in conversion from ts to nsec_tZbigniew Jędrzejewski-Szmek
CID #1320855.
2016-02-20test-siphash24: add a test for concatenating very short buffersZbigniew Jędrzejewski-Szmek
coverity seems to think that our siphash code can read past the end of a short buffer. Add a test which adds very short buffers with different combinations of length to the hash. Hashing is done twice, once with zeros following "data", and once with some other bytes following "data". The two results are then compared to verify that the result does not depend on bytes past the specified data length. (This test passes.)
2016-02-20Merge pull request #2675 from samueltardieu/llmnr-typoDaniel Mack
Fix typo on systemd-resolved log message
2016-02-20systemd-resolved: fix typo on log messageSamuel Tardieu
2016-02-19journal: defer journal closes on rotateVito Caputo
When we rotate journals, we must set offline and close the current one, but don't generally need to wait for this to complete. Instead, we'll initiate an asynchronous offline via journal_file_set_offline(oldfile, false), and add the file to a per-server set of deferred closes to be closed later when they won't block. There's one complication however; journal_file_open() via journal_file_verify_header() assumes that any writable journal in the online state is the product of an unclean shutdown or other form of corruption. Thus there's a need for journal_file_open() to be aware of deferred closes and synchronize with their completion when opening preexisting journals for writing. To facilitate this the deferred closes set is supplied to the journal_file_open() function where the deferred closes may be closed synchronously before verifying the header in such circumstances.
2016-02-19journal: asynchronous journal_file_set_offline()Vito Caputo
This adds a wait flag to journal_file_set_offline(), when false the offline is performed asynchronously in a separate thread. When wait is true, if an asynchronous offline is already in-progress it is restarted and waited for. Otherwise the offline is performed synchronously without the use of a thread. journal_file_set_online() cancels or waits for the asynchronous offline to complete if in-flight, depending on where in the offline process the thread happens to be. If the thread is in the fsync() phase, it is cancelled and waiting is unnecessary. Otherwise, the thread is joined before proceeding. A new offline_state member is added to JournalFile which is used via atomic operations for communicating between the offline thread and the journal_file_set_{offline,online}() functions.
2016-02-19journal: add void cast to journal_file_close() callsVito Caputo
2016-02-19journal: add void cast to fsync() callsVito Caputo
2016-02-19Merge pull request #2666 from keszybz/coverity-fixesZbigniew Jędrzejewski-Szmek
Coverity fixes
2016-02-19Merge pull request #2670 from hbrueckner/for-upstreamZbigniew Jędrzejewski-Szmek
udev/path_id: correct segmentation fault due to missing NULL check
2016-02-19Merge pull request #2668 from samueltardieu/systemd-resolve-manual-typoDaniel Mack
Fix typo in systemd-resolve man page
2016-02-19udev/path_id: correct segmentation fault due to missing NULL checkHendrik Brueckner
Running "udevadm test-builtin path_id /sys/devices/platform/" results in a segmentation fault. The problem is that udev_device_get_subsystem(dev) might return NULL in a streq() call. Solve this problem by using streq_ptr() instead.
2016-02-19systemd-resolve: fix typo in man pageSamuel Tardieu
2016-02-19Use (void) to silenc coverity on proc title changesZbigniew Jędrzejewski-Szmek
This is a cosmetic best-effort thing anyway.
2016-02-19resolved: fix NULL dereference in debug stmtZbigniew Jędrzejewski-Szmek
CID #1351544, #1351545.
2016-02-19Merge pull request #2661 from nwmcsween/nwmcsweenDaniel Mack
Include and internal struct member fixes.
2016-02-19Merge pull request #2660 from keszybz/memleaks-and-ubsanDaniel Mack
Memleaks and ubsan
2016-02-19Merge pull request #2662 from keszybz/activate-setenvDaniel Mack
activate: fix -E option parsing
2016-02-19Merge pull request #2648 from keszybz/dnssec-workMartin Pitt
Better support for DANE, shell completion
2016-02-18activate: fix -E option parsingZbigniew Jędrzejewski-Szmek
Fixes #2658.
2016-02-18time-util: rewrite check in a way that does not confuse gccZbigniew Jędrzejewski-Szmek
gcc thinks that multiplier might be unitialized. Split out the inner loop to make the function easier to grok.
2016-02-18test-hashmap: fix undefined behaviour on string constantsZbigniew Jędrzejewski-Szmek
The test was failing at -O2+ with gcc 5.3 and 6.0. "val1" == "val1" and "val1" != "val1" are both valid. http://stackoverflow.com/questions/4843640/why-is-a-a-in-c
2016-02-18journal/catalog: fix memory leaksZbigniew Jędrzejewski-Szmek
Various buffers were lost because finish_item() either consumed the buffer or allocated a new one (if an entry with the same key existed). The caller would simply forget the buffer in either case. Also add a check for the case when a valid identifier is followed by an empty body. We should not allow this. Also be more consistent in error handling and always print an error message.
2016-02-18basic/strbuf: do not call bsearch with a null argumentZbigniew Jędrzejewski-Szmek
Das ist verboten! src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2, which is declared to never be null
2016-02-18Don't use internal struct member namesNathan McSween
2016-02-18Remove/add (un)needed includesNathan McSween
2016-02-18Merge pull request #2644 from 0xAX/check-alloc-overflow-macroZbigniew Jędrzejewski-Szmek
alloc-util: extract overflow check into inline function
2016-02-19alloc-util: cleanupsAlexander Kuleshov
This patch contains a set of little cleanups for alloc-util.h: 1. The malloc_multiply(), realloc_multiply() and memdup_multiply() functions check allocation related parameters on overflow. Let's move them to the separate size_multiply_overflow() function for simplicity, code duplication prevention and possible reuse in future. 2. use SIZE_MAX from stdlib instead of ((size_t) - 1) to be more clear. 3. The 'a'/'b' variables are renamed to 'size' and 'need' to be more clear.'
2016-02-18Merge pull request #2621 from keszybz/wheel-groupMartin Pitt
build-sys: allow wheel group name to be specified
2016-02-18systemd-resolve: initial shell completionZbigniew Jędrzejewski-Szmek
v2: - use /sys/class/net to list interfaces, also copy the same code to systemd-nspawn v3: - do not propose "any" twice for --type
2016-02-18resolve: also allow SSHFP payload to be exportedZbigniew Jędrzejewski-Szmek
2016-02-18resolve: print TLSA packets in hexadecimalZbigniew Jędrzejewski-Szmek
https://tools.ietf.org/html/rfc6698#section-2.2 says: > The certificate association data field MUST be represented as a string > of hexadecimal characters. Whitespace is allowed within the string of > hexadecimal characters
2016-02-18systemd-resolve: easy querying of TLSA recordsZbigniew Jędrzejewski-Szmek
$ systemd-resolve --tlsa fedoraproject.org _443._tcp.fedoraproject.org IN TLSA 0 0 1 GUAL5bejH7czkXcAeJ0vCiRxwMnVBsDlBMBsFtfLF8A= -- Cert. usage: CA constraint -- Selector: Full Certificate -- Matching type: SHA-256 $ systemd-resolve --tlsa=tcp fedoraproject.org:443 _443._tcp.fedoraproject.org IN TLSA 0 0 1 GUAL5bejH7czkXcAeJ0vCiRxwMnVBsDlBMBsFtfLF8A= ... $ systemd-resolve --tlsa=udp fedoraproject.org _443._udp.fedoraproject.org: resolve call failed: '_443._udp.fedoraproject.org' not found v2: - use uint16_t - refuse port 0
2016-02-18Merge pull request #2646 from evverx/fix-2637Zbigniew Jędrzejewski-Szmek
Fix #2637 (doubled specifier expansion in ExecStart=)
2016-02-18Merge pull request #2653 from keszybz/test-dns-domainMartin Pitt
build-sys: remove duplicated entry in tests
2016-02-18build-sys: remove duplicated entry in testsZbigniew Jędrzejewski-Szmek
test-dns-domain should be built and run even without ENABLE_RESOLVED.
2016-02-18core: revert "core: resolve specifier in config_parse_exec()"Evgeny Vereshchagin
This reverts commit cb48dfca6a8bc15d9081651001a16bf51e03838a. Exec*-settings resolve specifiers twice: %%U -> config_parse_exec [cb48dfca6a8] -> %U -> service_spawn -> 0 Fixes #2637
2016-02-18Merge pull request #2652 from filbranden/testsresolved1Martin Pitt
Do not build tests that depend on resolved when it has been disabled
2016-02-18build-sys: Do not build tests that depend on resolved when it has been disabledFilipe Brandenburger
If ./configure --disable-resolved has been used, do not try to build test-dns-packet and test-resolve-tables which depend on it. Previously, the SOURCES, LIBS and LDADDs for these tests were made conditional while the main rules for them weren't, causing build failures trying to build a binary with no sources. This was uncovered when trying to build udeb for systemd in CI, which uses --disable-resolved for a minimal build, which uncovered the issue. Fixes #2651.
2016-02-17build-sys: allow references to wheel group to be omittedZbigniew Jędrzejewski-Szmek
https://github.com/systemd/systemd/issues/2492
2016-02-17tests: add test for https://github.com/systemd/systemd/issues/2637Evgeny Vereshchagin
+ perl -e 'exit(!(qq{0} eq qq{\x25U}))' exec-spec-interpolation.service: Main process exited, code=exited, status=1/FAILURE exec-spec-interpolation.service: Unit entered failed state. exec-spec-interpolation.service: Failed with result 'exit-code'. PID: 11270 Start Timestamp: Wed 2016-02-17 22:21:31 UTC Exit Timestamp: Wed 2016-02-17 22:21:31 UTC Exit Code: exited Exit Status: 1 Assertion 'service->main_exec_status.status == status_expected' failed at src/test/test-execute.c:65, function check(). Aborting.
2016-02-17Merge pull request #2640 from keszybz/dnssec-work-3Lennart Poettering
resolve: dumping of binary packets