Commit graph

13915 commits

Author SHA1 Message Date
Lennart Poettering 13b78323ba resolved: when doing NSEC3 proof, first find right NSEC3 suffix
When doing an NSEC3 proof, before detrmining whether a name is the
closest encloser we first need to figure out the longest common suffix
we have with any NSEC3 RR in the reply.
2015-12-26 19:09:10 +01:00
Lennart Poettering e7ff0e0b39 resolved: properly implement RRSIG validation of wildcarded RRsets
Note that this is still not complete, one additional step is still
missing: when we verified that a wildcard RRset is properly signed, we
still need to do an NSEC/NSEC3 proof that no more specific RRset exists.
2015-12-26 19:09:10 +01:00
Lennart Poettering d38d5ca65b resolved: never use data from failed transactions
Otherwise if we have an A lookup that failed DNSSEC validation, but an
AAAA lookup that succeeded, we might end up using the A data, but we
really should not.
2015-12-26 19:09:10 +01:00
Lennart Poettering 10b4504002 resolved: don't choke on NSEC/NSEC3 RRs with no bitmap
This might happen in some cases (empty non-terminals...) and we should
not choke on it.
2015-12-26 19:09:10 +01:00
Lennart Poettering 7d7fa31c62 bitmap: don't do bitwise XOR on booleans
It's weird doing bitwise operations on booleans. Let's use the boolean
XOR (i.e. "!=") instead of the bitweise XOR (i.e. "^") on them.
2015-12-26 19:09:10 +01:00
Lennart Poettering 0b8086379f util-lib: make sure more bitmap calls can deal with NULL objects fine 2015-12-26 19:09:10 +01:00
Lennart Poettering 7b50eb2efa resolved: internalize string buffer of dns_resource_record_to_string()
Let's simplify usage and memory management of DnsResourceRecord's
dns_resource_record_to_string() call: cache the formatted string as
part of the object, and return it on subsequent calls, freeing it when
the DnsResourceRecord itself is freed.
2015-12-26 19:09:10 +01:00
Lennart Poettering 0936416a1c resolved: when matching SOA RRs, don't eat up errors 2015-12-26 19:09:09 +01:00
Lennart Poettering 65b200e70d resolved: when matching SOA RRs, honour RR class 2015-12-26 19:09:09 +01:00
Lennart Poettering 81f7fc5e84 resolved: when looking for a SOA RR in a reply, pick the right one
If there are multiple SOA RRs, and we look for a suitable one covering
our request, then make sure to pick the one that is furthest away from
the root name, not just the first one we encounter.
2015-12-26 19:09:09 +01:00
Lennart Poettering a5444ca9fd resolved: when caching NXDOMAIN for an RR, make sure we flush out old ANY entries
We use ANY RR keys to store NXDOMAIN information, but we previously
didn't flush out old ANY RR items in the cache when adding new entries.
Fix that.
2015-12-26 19:09:09 +01:00
Lennart Poettering d3c7e9139c resolved: split out a new dns_type_may_redirect() call
Let's abstract which RRs shall honour CNAMEs, and which ones should not.
2015-12-26 19:09:09 +01:00
Lennart Poettering 40667ebe74 resolve-host: propagate error properly 2015-12-26 19:09:09 +01:00
Zbigniew Jędrzejewski-Szmek 720e593603 Merge pull request #2197 from mscherer/add_seal_config
Add Seal option in the configuration file for journald-remote
2015-12-25 11:16:18 -05:00
Zbigniew Jędrzejewski-Szmek d790d8c1b2 Merge pull request #2223 from ssahani/lldp
Closes #2223.
2015-12-25 00:40:07 -05:00
Susant Sahani 859c37b152 V3 LLDP: Add packet validation (system name and description)
LLDP type system name and system description should
be with in 255 characters and unique.

Let's add the validation to discard corrupt packets.
2015-12-25 10:48:23 +05:30
Susant Sahani e5c42b7ff1 lldp: improve logging 2015-12-25 10:42:43 +05:30
Zbigniew Jędrzejewski-Szmek cd81bc5802 Merge pull request #2153 from evverx/fix-verify-for-templates
analyze: verify verifies templates too
2015-12-24 23:59:48 -05:00
Lennart Poettering 7b8f930ce4 Merge pull request #2216 from zonque/nameownerchanged
core: re-sync bus name list after deserializing during daemon-reload
2015-12-24 00:46:19 +01:00
Daniel Mack 8936a5e34d core: re-sync bus name list after deserializing during daemon-reload
When the daemon reloads, it doesn not actually give up its DBus connection,
as wrongly stated in an earlier commit. However, even though the bus
connection stays open, the daemon flushes out all its internal state.

Hence, if there is a NameOwnerChanged signal after the flush and before the
deserialization, it cannot be matched against any pending unit.

To fix this, rename bus_list_names() to manager_sync_bus_names() and call
it explicitly at the end of the daemon reload operation.
2015-12-23 23:31:35 +01:00
Lennart Poettering 838c669055 Merge pull request #2158 from keszybz/journal-decompression
Journal decompression fixes
2015-12-23 21:31:07 +01:00
Daniel Mack 0a78712e81 socket: nullify pointers after free
A socket shouldn't be used after socket_done() returns, but follow the
general guideline here and avoid dangling pointers anyway.
2015-12-22 12:56:33 +01:00
Daniel Mack a97b23d65a socket: free fdname member
Plug a small memory leak.
2015-12-22 12:56:31 +01:00
Lennart Poettering a6cff5d3c0 Merge pull request #2202 from zonque/nameownerchanged
core: fix bus name synchronization after daemon-reload
2015-12-21 14:24:29 +01:00
Daniel Mack 55cbfaa54b sd-event: improve debugging of event source errors
Printing the pointer variable really doesn't help, so drop that.

Instead, add a string lookup table for the EventSourceType enum, and print
the type of event source in case of errors.
2015-12-21 13:03:24 +01:00
Daniel Mack d8ccf5fdc9 core: fix bus name synchronization after daemon-reload
During daemon-reload, PID1 temporarly loses its DBus connection, so there's
a small window in which all signals sent by dbus-daemon are lost.

This is a problem, since we rely on the NameOwnerChanged signals in order to
consider a service with Type=dbus fully started or terminated, respectively.

In order to fix this, a rewrite of bus_list_names() is necessary. We used
to walk the current list of names on the bus, and blindly triggered the
bus_name_owner_change() callback on each service, providing the actual name
as current owner. This implementation has a number of problems:

* We cannot detect if the the name was moved from one owner to the other
  while we were reloading

* We don't notify services which missed the name loss signal

* Providing the actual name as current owner is a hack, as the comment also
  admits.

To fix this, this patch carries the following changes:

* Track the name of the current bus name owner, and (de-)serialize it
  during reload. This way, we can detect changes.

* In bus_list_names(), walk the list of bus names we're interested in
  first, and then see if the name is active on the bus. If it is,
  check it it's still the same as it used to be, and synthesize
  NameOwnerChanged signals for the name add and/or loss.

This should fully synchronize the current name list with the internal
state of all services.
2015-12-21 11:23:08 +01:00
Thomas Hindoe Paaboel Andersen 097a251711 resolve: fix indentation 2015-12-20 16:59:24 +01:00
Michael Scherer 9d3737f13e Add Seal option in the configuration file for journald-remote
While journal received remotely can be sealed, it can only be done
on the command line using --seal, so for consistency, we will
also permit to set it in the configuration file.
2015-12-20 13:23:33 +01:00
Tom Gundersen d73fe9134f Merge pull request #2190 from poettering/dnssec6
Add DNSSEC proof of unsignedness and NSEC3 proof
2015-12-20 01:35:44 +00:00
Joost Bremmer 0671d7f463 Fix typo on logind-dbus.c
method_schedule_shutdown referenced org.freedesktop.login1.poweroff*
which is never registered in polkit.

Now refers to org.freedesktop.login1.power-off*

Signed-off-by: Joost Bremmer <toost.b@gmail.com>
2015-12-19 12:46:09 +01:00
Lennart Poettering 6773896e85 resolved: propagate DNSSEC validation status from auxiliary transactions
Let's make sure we propagate the DNSSEC validation status from an
auxiliary DNSSEC transaction back to the originating transaction, to
improve the error messages we generate.
2015-12-18 20:21:14 +01:00
Lennart Poettering 019036a47f resolved: propagate the DNSSEC result from the transaction to the query and the the bus client
It's useful to generate useful errors, so let's do that.
2015-12-18 20:09:30 +01:00
Lennart Poettering 3bbdc31df3 resolved: rename DNS_TRANSACTION_FAILURE → DNS_TRANSACTION_RCODE_FAILURE
We have many types of failure for a transaction, and
DNS_TRANSACTION_FAILURE was just one specific one of them, if the server
responded with a non-zero RCODE. Hence let's rename this, to indicate
which kind of failure this actually refers to.
2015-12-18 19:49:25 +01:00
Lennart Poettering 98b6be7784 resolved: merge two comments 2015-12-18 19:47:24 +01:00
Lennart Poettering 39963f1123 resolved: rename dns_cache_item_remove_and_free() → _unlink_and_free()
In most of the other call, we called similar functions that remove the
data structure link-ups to other objects "unlink", hence we should here,
too.
2015-12-18 19:44:15 +01:00
Lennart Poettering 2dda578f1e resolved: rename dns_cache_remove() → dns_cache_remove_by_key()
Given that we already have dns_cache_remove_by_rr() this makes clearer
what the operation actually does.
2015-12-18 19:43:10 +01:00
Lennart Poettering 2615691003 resolved: add a call that dumps the contents of a DnsAnswer structure
This is not used anywhere, but it's extremely useful when debugging.
2015-12-18 19:42:02 +01:00
Lennart Poettering d2579eec5e resolved: rework mDNS cache-flush bit handling
This adds a new DnsAnswer item flag "DNS_ANSWER_SHARED_OWNER" which is
set for mDNS RRs that lack the cache-flush bit. The cache-flush bit is
removed from the DnsResourceRecord object in favour of this.

This also splits out the code that removes previous entries when adding
new positive ones into a new separate call dns_cache_remove_previous().
2015-12-18 19:40:47 +01:00
Lennart Poettering ea207b639a resolved: properly determine size of DnsAnswer object
After all we want to allow NULL DnsAnswer objects as equivalent to empty
ones, hence we should use the right checks everywhere.
2015-12-18 19:31:21 +01:00
Lennart Poettering eed749cca6 resolved: pass out precise authenticated bit we got passed in
Make sure the cache never altes the authenticated bit of RRs stored in
it, and drops it for RRs when passing it out again.
2015-12-18 19:29:50 +01:00
Lennart Poettering 9a9999a713 resolved: don't honour mDNS cache-flush bit for OPT RRs
OPT RRs after all use the class field for other purposes than actually
encoding a class, hence the cache flush bit doesn't apply really.
2015-12-18 19:27:16 +01:00
Lennart Poettering ef9a3e3c28 resolve: optimize dns_cache_flush() a bit
Let's use dns_cache_remove() rather than
dns_cache_item_remove_and_free() to destroy the cache, since the former
requires far fewer hash table lookups.
2015-12-18 19:25:04 +01:00
Lennart Poettering f5bdeb01e4 resolved: when receiving a TTL=0 RR, only flush that specific RR
When we receieve a TTL=0 RR, then let's only flush that specific RR and
not the whole RRset.

On mDNS with RRsets that a shared-owner this is how specific RRs are
removed from the set, hence support this. And on non-mDNS the whole
RRset will already be removed much earlier in dns_cache_put() hence
there's no reason remove it again.
2015-12-18 19:22:26 +01:00
Lennart Poettering 1f97052fe0 resolved: optimize dns_cache_remove() a bit 2015-12-18 19:19:56 +01:00
Lennart Poettering 950b692bfb resolved: use dns_name_parent() where appropriate 2015-12-18 19:15:34 +01:00
Lennart Poettering fd009cd80e resolved: check SOA authentication state when negative caching
We should never use the TTL of an unauthenticated SOA to cache an
authenticated RR.
2015-12-18 19:12:48 +01:00
Lennart Poettering 1069048089 resolved: don't call dns_cache_remove() from dns_cache_put_negative()
We call it anyway as one of the first calls in dns_cache_put(), hence
there's no reason to do this multiple times.
2015-12-18 19:09:27 +01:00
Lennart Poettering d98e550420 resolved: bump cache size a bit
Let's keep entries for longer and more of them. After all, due to the
DNSSEC hookup the amount of RRs we need to store is much higher now.
2015-12-18 19:07:31 +01:00
Lennart Poettering 222148b66d resolved: make use of dns_{class|type}_is_{pseudo|valid_rr}() everywhere 2015-12-18 19:06:23 +01:00
Lennart Poettering ff7febd50a resolved: refuse accepting EDNS0 OPT RRs with a non-root domain 2015-12-18 18:57:08 +01:00