Commit graph

23943 commits

Author SHA1 Message Date
Lennart Poettering f7014757fd resolved: make sure we don't get confused when notifying transactions while they are destroyed
A failing transaction might cause other transactions to fail too, and
thus the set of transactions to notify for a transaction might change
while we are notifying them. Protect against that.
2015-12-18 14:48:49 +01:00
Lennart Poettering a0c888c78c resolved: merge two bools into a bitfield 2015-12-18 14:48:49 +01:00
Lennart Poettering deb3f3d335 resolved: use right format specifier to print transaction ID 2015-12-18 14:48:49 +01:00
Lennart Poettering a5784c4985 resolved: cache stringified transaction key once per transaction
We end up needing the stringified transaction key in many log messages,
hence let's simplify the logic and cache it inside of the transaction:
generate it the first time we need it, and reuse it afterwards. Free it
when the transaction goes away.

This also updated a couple of log messages to make use of this.
2015-12-18 14:48:49 +01:00
Lennart Poettering 1ade96e980 resolved: don't complain if networkd doesn't know an interface we care about 2015-12-18 14:48:49 +01:00
Lennart Poettering f7455baa01 shared: add dns_name_parent() call to determine parent domain of a domain 2015-12-18 14:48:49 +01:00
Daniel Mack 47260caf02 Merge pull request #2180 from phomes/resolve-misc
Resolve: misc cleanups
2015-12-16 20:14:36 +01:00
Thomas Hindoe Paaboel Andersen b78b0b674f resolve: remove unused variable 2015-12-16 19:59:45 +01:00
Thomas Hindoe Paaboel Andersen 111befce55 resolve: fix indendation 2015-12-16 19:59:45 +01:00
Daniel Mack 523f8874c6 Merge pull request #2157 from keszybz/manager-status
Manager status
2015-12-15 15:57:19 +01:00
Daniel Mack 277b4cb5a6 Merge pull request #2174 from yuwata/journal-remote-man
man: fix typo in journal-remote.conf(5)
2015-12-15 15:56:19 +01:00
Yu Watanabe 190f373bc8 man: fix typo in journal-remote.conf(5) 2015-12-15 23:24:28 +09:00
Tom Gundersen ab501843d6 Merge pull request #2168 from poettering/dnssec5
Fifth batch of DNSSEC support patches
2015-12-15 12:25:22 +00:00
Daniel Mack 52d3240b15 Merge pull request #2169 from yuwata/journal-remote-unit-doc
journal-remote: add documents in the unit files
2015-12-15 11:33:57 +01:00
Daniel Mack cbdb172efc Merge pull request #2172 from evverx/fix-enable-hashmap
basic: ENABLE_DEBUG_HASHMAP needs <pthread.h>
2015-12-15 10:33:38 +01:00
Henrik Kaare Poulsen 3d4db144b0 basic: ENABLE_DEBUG_HASHMAP needs <pthread.h>
this is a follow-up for commit 11c3a36649
2015-12-15 07:10:50 +00:00
Yu Watanabe c9d493281d journal-remote: add documents in the unit files 2015-12-15 10:51:12 +09:00
Lennart Poettering 73b8d8e928 resolved: update DNSSEC TODO 2015-12-14 21:32:17 +01:00
Lennart Poettering 72667f0890 resolved: add basic proof of non-existance support for NSEC+NSEC3
Note that this is not complete yet, as we don't handle wildcard domains
correctly, nor handle domains correctly that use empty non-terminals.
2015-12-14 21:28:39 +01:00
Lennart Poettering d0ae14ff09 resolved: when serializing NSEC3 windows, don't write more windows than necessary 2015-12-14 21:28:39 +01:00
Lennart Poettering e1a9f1a81d resolved: constify a parameter 2015-12-14 21:28:39 +01:00
Lennart Poettering 24a5b982cf resolved: always consider NSEC/NSEC3 RRs as "primary"
It's not OK to drop these for our proof of non-existance checks.
2015-12-14 21:28:39 +01:00
Lennart Poettering 5264131a9a resolved: don't choke on NULL DNS transactions when determining query candidate state 2015-12-14 21:28:39 +01:00
Lennart Poettering 0638401af3 resolved: initialize libgcrypt before using it 2015-12-14 21:28:39 +01:00
Lennart Poettering a1972a9185 resolved: rework how we get the gcrypt digest algorithm ID from DNSSEC digest ids
Let's move this into a function digest_to_gcrypt() that we can reuse
later on when implementing NSEC3 validation.
2015-12-14 21:28:39 +01:00
Lennart Poettering a3db237b8f resolved: apparently not all names are used in canonical form for DNSSEC validation
Specifically, it appears as if the NSEC next domain name should be in
the original casing rather than canonical form, when validating.
2015-12-14 21:28:39 +01:00
Daniel Mack 654d1b3350 Merge pull request #2165 from torstehu/fix-typo2
treewide: fix typos and indentation
2015-12-14 16:31:25 +01:00
Torstein Husebø e5abebabb3 treewide: fix typos and indentation 2015-12-14 15:53:11 +01:00
Zbigniew Jędrzejewski-Szmek 4cee3a78bb manager: log log level changes uniformly
Output the same message when a request to change the log level is
received over dbus and through a signal. From the user point of view
those two operations are very similar and it's easy to think that the
dbus operation didn't work when the expected message is not emitted.

Also "downgrade" the message level to info, since this is a normal
user initiated action.
2015-12-13 14:53:52 -05:00
Zbigniew Jędrzejewski-Szmek 76b6f3f68f manager: move status output change debug messages to set function
This way we can only print the debug message when the status actually
changes. We also means we don't print anything when running in --user
mode, where status output is always disabled.
2015-12-13 14:52:19 -05:00
Daniel Mack dc0306aac4 Merge pull request #2152 from evverx/respect-disable-tests
build-sys: fix --disable-tests
2015-12-13 17:22:48 +01:00
Evgeny Vereshchagin 5433c3e1a3 build-sys: fix --disable-tests
Fixes:
$ ./configure ... --disable-tests
$ make
$ sudo make check
FAIL: test/udev-test.pl
PASS: test/rule-syntax-check.py
PASS: test/sysv-generator-test.py
...
2015-12-13 07:50:11 +00:00
Daniel Mack afcaed0cad Merge pull request #2148 from evverx/fix-enable-smack
build-sys: fix ./configure --enable-smack
2015-12-12 14:03:52 +01:00
Evgeny Vereshchagin c0957da3f4 build-sys: refactor have_smack detection 2015-12-12 06:08:25 +00:00
Evgeny Vereshchagin 566c9f5ad5 build-sys: fix ./configure --enable-smack
Fixes:

$ ./configure ... --enable-smack
$ make src/core/load-fragment-gperf.c
$ grep -i smack src/core/load-fragment-gperf.c
{"Swap.SmackProcessLabel", config_parse_warn_compat, DISABLED_CONFIGURATION, 0},
...

should be
{"Swap.SmackProcessLabel", config_parse_exec_smack_process_label, 0, offsetof(Swap, exec_context)},
...
2015-12-12 03:53:22 +00:00
Tom Gundersen a036133175 Merge pull request #2143 from poettering/dnssec4
Another batch of DNSSEC fixes
2015-12-11 18:38:14 +01:00
Lennart Poettering 29c1519ed4 resolved: don't eat up errors
dns_resource_key_match_soa() and dns_resource_key_match_cname_or_dname()
may return errors as negative return values. Make sure to propagate
those.
2015-12-11 15:10:56 +01:00
Lennart Poettering 56352fe92d resolved: refactor DNSSEC answer validation
This changes answer validation to be more accepting to unordered RRs in
responses. The agorithm we now implement goes something like this:

  1. populate validated keys list for this transaction from DS RRs
  2. as long as the following changes the unvalidated answer list:
    2a. try to validate the first RRset we find in unvalidated answer
        list
    2b. if that worked: add to validated answer; if DNSKEY also add to
        validated keys list; remove from unvalidated answer.
    2c. continue at 2a, with the next RRset, or restart from the
        beginning when we hit the end
  3. as long as the following changes the unvalidated answer list:
    3a. try to validate the first RRset again. This will necessarily
        fail, but we learn the precise error
    3b. If this was a "primary" response to the question, fail the
        entire transaction. "Primary" in this context means that it is
        directly a response to the query, or a CNAME/DNAME for it.
    3c. Otherwise, remove the RRset from the unvalidated answer list.

Note that we the too loops in 2 + 3 are actually coded as a single one,
but the dnskeys_finalized bool indicates which loop we are currently
processing.

Note that loop 2 does not drop any invalidated RRsets yet, that's
something only loop 3 does. This is because loop 2 might still encounter
additional DNSKEYS which might validate more stuff, and if we'd already
have dropped those RRsets we couldn't validate those anymore. The first
loop is hence a "constructive" loop, the second loop a "destructive"
one: the first one validates whatever is possible, the second one then
deletes whatever still isn't.
2015-12-11 14:15:27 +01:00
Lennart Poettering 203f1b35d9 resolved: rework dnssec validation results
This adds a new validation result DNSSEC_UNSUPPORTED_ALGORITHM which is
returned when we encounter an unsupported crypto algorithm when trying
to validate RRSIG/DNSKEY combinations. Previously we'd return ENOTSUPP
in this case, but it's better to consider this a non-error DNSSEC
validation result, since our reaction to this case needs to be more like
in cases such as expired or missing keys: we need to keep continue
validation looking for another RRSIG/DNSKEY combination that works
better for us.

This also reworks how dnssec_validate_rrsig_search() propagates errors
from dnssec_validate_rrsig(). Previously, errors such as unsupported
algorithms or expired signatures would not be propagated, but simply be
returned as "missing-key".
2015-12-11 14:14:27 +01:00
Lennart Poettering 79e2493138 resolved: rework how and when the number of answer RRs to cache is determined
Instead of figuring out how many RRs to cache right before we do so,
determine this at the time we install the answer RRs, so that we can
still alter this as we manipulate the answer during validation.

The primary purpose of this is to pave the way so that we can drop
unsigned RRsets from the answer and invalidate the number of RRs to
cache at the same time.
2015-12-11 14:14:27 +01:00
Lennart Poettering c463eb783e resolved: generalize DNS RR type validity checks
Check the validity of RR types as we parse or receive data from IPC
clients, and use the same code for all of them.
2015-12-11 14:14:27 +01:00
Lennart Poettering e6b57b3787 resolved: refuse OPT RRs in incoming packets that are not in the additional section
We later rely that the DnsAnswer object contains all RRs from the
original packet, at least when it comes to the answer and authorization
sections, hence we better make sure we don#t silently end up removing an
OPT RR from these two sections.
2015-12-11 14:14:27 +01:00
Lennart Poettering c33be4a6f2 resolved: refuse to cache ANY kind of pseudo-RR-type 2015-12-11 14:14:27 +01:00
Lennart Poettering 6728a58d10 resolved: no need to check for NULL explicitly before invoking dns_packet_unref() 2015-12-11 14:13:31 +01:00
Lennart Poettering bea4c76fa0 resolved: extend list of pseudo RR types
Also, explain the situation with a longer comment.
2015-12-11 14:13:31 +01:00
Daniel Mack c57d67f718 Merge pull request #2096 from teg/resolved-cache
Misc resolved cache fixes
2015-12-10 20:48:42 +01:00
Tom Gundersen a257f9d4a5 resolved: cache - only stringify RR keys when in debug mode
This is in the fast path, so let's not do all this work unneccessarily.
2015-12-10 20:17:49 +01:00
Tom Gundersen 02c2857b8d resolved: cache - don't flush the cache of mDNS records unneccesarily
When the DNS_RESOURCE_KEY_CACHE_FLUSH flag is not set for an mDNS packet, we should not flush
the cache for RRs with matching keys. However, we were unconditionally flushing the cache
also for these packets.

Now mark all packets as cache_flush by default, except for these mDNS packets, and respect
that flag in the cache handling.

This fixes 90325e8c2e.
2015-12-10 20:15:58 +01:00
Tom Gundersen 2250592422 TODO 2015-12-10 19:47:47 +01:00
Daniel Mack 7b56301a88 Merge pull request #2133 from poettering/import-drop-dkr
importd: drop dkr support
2015-12-10 17:40:39 +01:00