1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-04 17:47:03 +03:00

24263 Commits

Author SHA1 Message Date
Lennart Poettering
ff7febd50a resolved: refuse accepting EDNS0 OPT RRs with a non-root domain 2015-12-18 18:57:08 +01:00
Lennart Poettering
4b548ef382 resolved: move DNS class utilities to dns-type.c and add more helpers
Let's make DNS class helpers more like DNS type helpers, let's move them
from resolved-dns-rr.[ch] into dns-type.[ch].

This also adds two new calls dns_class_is_pseudo() and
dns_class_is_valid_rr() which operate similar to dns_type_is_pseudo()
and dns_type_is_valid_rr() but for classes instead of types.

This should hopefully make handling of DNS classes and DNS types more
alike.
2015-12-18 18:53:11 +01:00
Lennart Poettering
3e92a71901 resolved: update TODO 2015-12-18 14:48:50 +01:00
Lennart Poettering
105e151299 resolved: add support NSEC3 proofs, as well as proofs for domains that are OK to be unsigned
This large patch adds a couple of mechanisms to ensure we get NSEC3 and
proof-of-unsigned support into place. Specifically:

- Each item in an DnsAnswer gets two bit flags now:
  DNS_ANSWER_AUTHENTICATED and DNS_ANSWER_CACHEABLE. The former is
  necessary since DNS responses might contain signed as well as unsigned
  RRsets in one, and we need to remember which ones are signed and which
  ones aren't. The latter is necessary, since not we need to keep track
  which RRsets may be cached and which ones may not be, even while
  manipulating DnsAnswer objects.

- The .n_answer_cachable of DnsTransaction is dropped now (it used to
  store how many of the first DnsAnswer entries are cachable), and
  replaced by the DNS_ANSWER_CACHABLE flag instead.

- NSEC3 proofs are implemented now (lacking support for the wildcard
  part, to be added in a later commit).

- Support for the "AD" bit has been dropped. It's unsafe, and now that
  we have end-to-end authentication we don't need it anymore.

- An auxiliary DnsTransaction of a DnsTransactions is now kept around as
  least as long as the latter stays around. We no longer remove the
  auxiliary DnsTransaction as soon as it completed. THis is necessary,
  as we now are interested not only in the RRsets it acquired but also
  in its authentication status.
2015-12-18 14:48:50 +01:00
Lennart Poettering
aae6a86e1a resolved: refuse to add auxiliary transactions loops
Let's be safe and explicitly avoid that we add an auxiliary transaction
dependency on ourselves.
2015-12-18 14:48:50 +01:00
Lennart Poettering
1849cb7cb7 resolved: don't check for NULL DnsAnswer object explicitly where unnecessary
The DNS_ANSWER_FOREACH macros do this internally anyway, no need to
duplicate this.
2015-12-18 14:48:49 +01:00
Lennart Poettering
423659abb8 resolved: stop timeout timer when validating transactions
We need no separate timeout anymore as soon as we received a reply, as
the auxiliary transactions have their own timeouts.
2015-12-18 14:48:49 +01:00
Lennart Poettering
f4e380379a resolved: when destroying a scope, only abort live transactions 2015-12-18 14:48:49 +01:00
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 11c3a36649e5e5e77db499c92f3
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
Dan Dedrick
11bb5147b3 journal-gatewayd: timeout journal wait to allow thread cleanup
When a client connects with follow=1 and then disconnects we can get
stuck in sd_journal_wait indefinitely if no journal messages are logged.
Every time a client does this another thread is allocated and these
continue to stack until either a journal message is logged or we run out
of mapping to put a stack in.

By adding a timeout if we don't see any journal messages in that timeout
we will simply pop back out to microhttpd which will sanity check the
connection for us and if it is still connected pop us back into the wait
for more journal messages.
2015-12-14 08:50:07 -05:00
Evgeny Vereshchagin
25f17e47f9 analyze: verify verifies templates too
Fixes:
$ systemd-analyze verify a@.service
Failed to load a@.service: Invalid argument
2015-12-14 07:11:03 +00:00
Zbigniew Jędrzejewski-Szmek
ae5e1b19e7 journal: add the "repeating sequence" test case
This was the case that caused various problems that were fixed in
preceding patches, so it is good to add a test that uses it directly.

In "may_fail" test cases try again with a bigger buffer.

Instead of allocating various buffers on the stack, malloc them.
This is more reliable in case of big buffers, and allows tools like
valgrind and address sanitizer to find overflows more easily.
2015-12-13 15:00:30 -05:00
Zbigniew Jędrzejewski-Szmek
e3cc7fc45b journal: add "xfail" test for partial lz4 decompression
Add a test that LZ4_decompress_safe_partial does (not) work as
expected, so that if it starts to work at some point, we'll catch
this and adjust our code.
2015-12-13 15:00:30 -05:00
Zbigniew Jędrzejewski-Szmek
d487b81513 journal: fix reporting of output size in compres_stream_lz4
The header is 7 bytes, and this size was not accounted for in
total_out. This means that we could create a file that was 7 bytes
longer than requested, and the debug output was also inconsistent.
2015-12-13 15:00:19 -05:00
Zbigniew Jędrzejewski-Szmek
5d6f46b6bf journal: add dst_allocated_size parameter for compress_blob
compress_blob took src, src_size, dst and *dst_size, but dst_size
wasn't used as an input parameter with the size of dst, but only as an
output parameter. dst was implicitly assumed to be at least src_size-1.

This code wasn't *wrong*, because the only real caller in
journal-file.c got it right. But it was misleading, and the tests in
test-compress.c got it wrong, and worked only because the output
buffer happened to be the same size as input buffer. So add a seperate
dst_allocated_size parameter to make it explicit what the size of the
buffer is, and to allow test to proceed with different output buffer
sizes.
2015-12-13 14:54:47 -05:00
Zbigniew Jędrzejewski-Szmek
1f4b467daa journal: in some cases we have to decompress the full lz4 field
lz4 has to decompress a whole "sequence" at a time. When the compressed
data is composed of a repeating pattern, the whole set of repeats has
do be docompressed, and the output buffer has to be big enough.

This is unfortunate, because potentially the slowdown is very big. We
are only interested in the field name, but we might have to decompress
the whole thing. But the full cost will be borne out only when the
full entry is a repeating pattern. In practice this shouldn't happen
(apart from tests and the like). Hopefully lz4 will be fixed to avoid
this problem, or it will grow a new function which we can use [1], so
this fix should be remporary.

[1] https://groups.google.com/d/msg/lz4c/_3kkz5N6n00/oTahzqErCgAJ
2015-12-13 14:54:47 -05:00
Zbigniew Jędrzejewski-Szmek
2aaec9b4f6 journal: decompress_startswith can return an error
The return value was used directly in an if, so an error was treated
as success; we need to bail out instead. An error should not happen,
unless we have a compression/decompression mismatch, so output a debug
line.
2015-12-13 14:54:47 -05:00
Zbigniew Jędrzejewski-Szmek
e64c53fd05 journal: properly handle an unexpectedly missing field
parse_field() checks if the field has the expected format, and returns
0 if it doesn't. In that case, value and size are not
set. Nevertheless, we would try to continue, and hit an assert in
safe_atou64. This case shouldn't happen, unless sd_j_get_data is borked,
so cleanly assert that we got the expected field.

Also, oom is the only way that parse_field can fail, which we log
already. Instead of outputting a debug statement and carrying on,
treat oom as fatal.
2015-12-13 14:54:47 -05: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