]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 years agocore: re-sync bus name list after deserializing during daemon-reload 2216/head
Daniel Mack [Tue, 22 Dec 2015 10:37:09 +0000 (11:37 +0100)] 
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.

8 years agoMerge pull request #2202 from zonque/nameownerchanged 2218/head
Lennart Poettering [Mon, 21 Dec 2015 13:24:29 +0000 (14:24 +0100)] 
Merge pull request #2202 from zonque/nameownerchanged

core: fix bus name synchronization after daemon-reload

8 years agoMerge pull request #2204 from zonque/sd-event-debug
Lennart Poettering [Mon, 21 Dec 2015 13:21:29 +0000 (14:21 +0100)] 
Merge pull request #2204 from zonque/sd-event-debug

sd-event: improve debugging of event source errors

8 years agosd-event: improve debugging of event source errors 2204/head
Daniel Mack [Mon, 21 Dec 2015 12:03:24 +0000 (13:03 +0100)] 
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.

8 years agoMerge pull request #2203 from mbiebl/man-typo-fix
Daniel Mack [Mon, 21 Dec 2015 11:09:46 +0000 (12:09 +0100)] 
Merge pull request #2203 from mbiebl/man-typo-fix

man: fix typo in systemctl(1)

8 years agoman: fix typo in systemctl(1) 2203/head
Michael Biebl [Mon, 21 Dec 2015 10:54:41 +0000 (11:54 +0100)] 
man: fix typo in systemctl(1)

8 years agocore: fix bus name synchronization after daemon-reload 2202/head
Daniel Mack [Fri, 18 Dec 2015 16:28:15 +0000 (17:28 +0100)] 
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.

8 years agoMerge pull request #2199 from phomes/resolve-indentation
Daniel Mack [Sun, 20 Dec 2015 18:46:19 +0000 (19:46 +0100)] 
Merge pull request #2199 from phomes/resolve-indentation

resolve: fix indentation

8 years agoresolve: fix indentation 2199/head
Thomas Hindoe Paaboel Andersen [Sun, 20 Dec 2015 15:58:44 +0000 (16:58 +0100)] 
resolve: fix indentation

8 years agoMerge pull request #2190 from poettering/dnssec6
Tom Gundersen [Sun, 20 Dec 2015 01:35:44 +0000 (01:35 +0000)] 
Merge pull request #2190 from poettering/dnssec6

Add DNSSEC proof of unsignedness and NSEC3 proof

8 years agoMerge pull request #2193 from ToostInc/logindbus-typo-fix
Daniel Mack [Sat, 19 Dec 2015 23:58:19 +0000 (00:58 +0100)] 
Merge pull request #2193 from ToostInc/logindbus-typo-fix

Fix typo on logind-dbus.c

8 years agoFix typo on logind-dbus.c 2193/head
Joost Bremmer [Sat, 19 Dec 2015 11:46:09 +0000 (12:46 +0100)] 
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>
8 years agoresolved: propagate DNSSEC validation status from auxiliary transactions 2190/head
Lennart Poettering [Fri, 18 Dec 2015 19:21:14 +0000 (20:21 +0100)] 
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.

8 years agoresolved: propagate the DNSSEC result from the transaction to the query and the the...
Lennart Poettering [Fri, 18 Dec 2015 19:09:30 +0000 (20:09 +0100)] 
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.

8 years agoresolved: rename DNS_TRANSACTION_FAILURE → DNS_TRANSACTION_RCODE_FAILURE
Lennart Poettering [Fri, 18 Dec 2015 18:49:25 +0000 (19:49 +0100)] 
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.

8 years agoresolved: merge two comments
Lennart Poettering [Fri, 18 Dec 2015 18:46:27 +0000 (19:46 +0100)] 
resolved: merge two comments

8 years agoresolved: rename dns_cache_item_remove_and_free() → _unlink_and_free()
Lennart Poettering [Fri, 18 Dec 2015 18:44:15 +0000 (19:44 +0100)] 
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.

8 years agoresolved: rename dns_cache_remove() → dns_cache_remove_by_key()
Lennart Poettering [Fri, 18 Dec 2015 18:43:10 +0000 (19:43 +0100)] 
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.

8 years agoresolved: add a call that dumps the contents of a DnsAnswer structure
Lennart Poettering [Fri, 18 Dec 2015 18:42:02 +0000 (19:42 +0100)] 
resolved: add a call that dumps the contents of a DnsAnswer structure

This is not used anywhere, but it's extremely useful when debugging.

8 years agoresolved: rework mDNS cache-flush bit handling
Lennart Poettering [Fri, 18 Dec 2015 18:32:46 +0000 (19:32 +0100)] 
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().

8 years agoresolved: properly determine size of DnsAnswer object
Lennart Poettering [Fri, 18 Dec 2015 18:31:21 +0000 (19:31 +0100)] 
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.

8 years agoresolved: pass out precise authenticated bit we got passed in
Lennart Poettering [Fri, 18 Dec 2015 18:29:47 +0000 (19:29 +0100)] 
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.

8 years agoresolved: don't honour mDNS cache-flush bit for OPT RRs
Lennart Poettering [Fri, 18 Dec 2015 18:27:16 +0000 (19:27 +0100)] 
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.

8 years agoresolve: optimize dns_cache_flush() a bit
Lennart Poettering [Fri, 18 Dec 2015 18:25:04 +0000 (19:25 +0100)] 
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.

8 years agoresolved: when receiving a TTL=0 RR, only flush that specific RR
Lennart Poettering [Fri, 18 Dec 2015 18:22:26 +0000 (19:22 +0100)] 
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.

8 years agoresolved: optimize dns_cache_remove() a bit
Lennart Poettering [Fri, 18 Dec 2015 18:19:56 +0000 (19:19 +0100)] 
resolved: optimize dns_cache_remove() a bit

8 years agoresolved: use dns_name_parent() where appropriate
Lennart Poettering [Fri, 18 Dec 2015 18:15:34 +0000 (19:15 +0100)] 
resolved: use dns_name_parent() where appropriate

8 years agoresolved: check SOA authentication state when negative caching
Lennart Poettering [Fri, 18 Dec 2015 18:12:48 +0000 (19:12 +0100)] 
resolved: check SOA authentication state when negative caching

We should never use the TTL of an unauthenticated SOA to cache an
authenticated RR.

8 years agoresolved: don't call dns_cache_remove() from dns_cache_put_negative()
Lennart Poettering [Fri, 18 Dec 2015 18:09:27 +0000 (19:09 +0100)] 
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.

8 years agoresolved: bump cache size a bit
Lennart Poettering [Fri, 18 Dec 2015 18:07:31 +0000 (19:07 +0100)] 
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.

8 years agoresolved: make use of dns_{class|type}_is_{pseudo|valid_rr}() everywhere
Lennart Poettering [Fri, 18 Dec 2015 18:06:23 +0000 (19:06 +0100)] 
resolved: make use of dns_{class|type}_is_{pseudo|valid_rr}() everywhere

8 years agoresolved: refuse accepting EDNS0 OPT RRs with a non-root domain
Lennart Poettering [Fri, 18 Dec 2015 17:57:08 +0000 (18:57 +0100)] 
resolved: refuse accepting EDNS0 OPT RRs with a non-root domain

8 years agoresolved: move DNS class utilities to dns-type.c and add more helpers
Lennart Poettering [Fri, 18 Dec 2015 17:53:11 +0000 (18:53 +0100)] 
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.

8 years agoresolved: update TODO
Lennart Poettering [Fri, 18 Dec 2015 13:48:24 +0000 (14:48 +0100)] 
resolved: update TODO

8 years agoresolved: add support NSEC3 proofs, as well as proofs for domains that are OK to...
Lennart Poettering [Fri, 18 Dec 2015 13:37:06 +0000 (14:37 +0100)] 
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.

8 years agoresolved: refuse to add auxiliary transactions loops
Lennart Poettering [Fri, 18 Dec 2015 13:33:59 +0000 (14:33 +0100)] 
resolved: refuse to add auxiliary transactions loops

Let's be safe and explicitly avoid that we add an auxiliary transaction
dependency on ourselves.

8 years agoresolved: don't check for NULL DnsAnswer object explicitly where unnecessary
Lennart Poettering [Fri, 18 Dec 2015 13:29:32 +0000 (14:29 +0100)] 
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.

8 years agoresolved: stop timeout timer when validating transactions
Lennart Poettering [Fri, 18 Dec 2015 13:26:48 +0000 (14:26 +0100)] 
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.

8 years agoresolved: when destroying a scope, only abort live transactions
Lennart Poettering [Fri, 18 Dec 2015 13:26:02 +0000 (14:26 +0100)] 
resolved: when destroying a scope, only abort live transactions

8 years agoresolved: make sure we don't get confused when notifying transactions while they...
Lennart Poettering [Fri, 18 Dec 2015 13:23:48 +0000 (14:23 +0100)] 
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.

8 years agoresolved: merge two bools into a bitfield
Lennart Poettering [Fri, 18 Dec 2015 13:22:46 +0000 (14:22 +0100)] 
resolved: merge two bools into a bitfield

8 years agoresolved: use right format specifier to print transaction ID
Lennart Poettering [Fri, 18 Dec 2015 13:22:14 +0000 (14:22 +0100)] 
resolved: use right format specifier to print transaction ID

8 years agoresolved: cache stringified transaction key once per transaction
Lennart Poettering [Fri, 18 Dec 2015 13:20:03 +0000 (14:20 +0100)] 
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.

8 years agoresolved: don't complain if networkd doesn't know an interface we care about
Lennart Poettering [Fri, 18 Dec 2015 13:16:48 +0000 (14:16 +0100)] 
resolved: don't complain if networkd doesn't know an interface we care about

8 years agoshared: add dns_name_parent() call to determine parent domain of a domain
Lennart Poettering [Fri, 18 Dec 2015 13:16:03 +0000 (14:16 +0100)] 
shared: add dns_name_parent() call to determine parent domain of a domain

8 years agoMerge pull request #2180 from phomes/resolve-misc
Daniel Mack [Wed, 16 Dec 2015 19:14:36 +0000 (20:14 +0100)] 
Merge pull request #2180 from phomes/resolve-misc

Resolve: misc cleanups

8 years agoresolve: remove unused variable 2180/head
Thomas Hindoe Paaboel Andersen [Wed, 16 Dec 2015 18:33:20 +0000 (19:33 +0100)] 
resolve: remove unused variable

8 years agoresolve: fix indendation
Thomas Hindoe Paaboel Andersen [Wed, 16 Dec 2015 18:26:16 +0000 (19:26 +0100)] 
resolve: fix indendation

8 years agoMerge pull request #2157 from keszybz/manager-status
Daniel Mack [Tue, 15 Dec 2015 14:57:19 +0000 (15:57 +0100)] 
Merge pull request #2157 from keszybz/manager-status

Manager status

8 years agoMerge pull request #2174 from yuwata/journal-remote-man
Daniel Mack [Tue, 15 Dec 2015 14:56:19 +0000 (15:56 +0100)] 
Merge pull request #2174 from yuwata/journal-remote-man

man: fix typo in journal-remote.conf(5)

8 years agoman: fix typo in journal-remote.conf(5) 2174/head
Yu Watanabe [Tue, 15 Dec 2015 14:24:28 +0000 (23:24 +0900)] 
man: fix typo in journal-remote.conf(5)

8 years agoMerge pull request #2168 from poettering/dnssec5
Tom Gundersen [Tue, 15 Dec 2015 12:25:22 +0000 (12:25 +0000)] 
Merge pull request #2168 from poettering/dnssec5

Fifth batch of DNSSEC support patches

8 years agoMerge pull request #2169 from yuwata/journal-remote-unit-doc
Daniel Mack [Tue, 15 Dec 2015 10:33:57 +0000 (11:33 +0100)] 
Merge pull request #2169 from yuwata/journal-remote-unit-doc

journal-remote: add documents in the unit files

8 years agoMerge pull request #2172 from evverx/fix-enable-hashmap
Daniel Mack [Tue, 15 Dec 2015 09:33:38 +0000 (10:33 +0100)] 
Merge pull request #2172 from evverx/fix-enable-hashmap

basic: ENABLE_DEBUG_HASHMAP needs <pthread.h>

8 years agobasic: ENABLE_DEBUG_HASHMAP needs <pthread.h> 2172/head
Henrik Kaare Poulsen [Sun, 13 Dec 2015 18:31:05 +0000 (19:31 +0100)] 
basic: ENABLE_DEBUG_HASHMAP needs <pthread.h>

this is a follow-up for commit 11c3a36649e5e5e77db499c92f3

8 years agojournal-remote: add documents in the unit files 2169/head
Yu Watanabe [Tue, 15 Dec 2015 01:51:12 +0000 (10:51 +0900)] 
journal-remote: add documents in the unit files

8 years agoresolved: update DNSSEC TODO 2168/head
Lennart Poettering [Mon, 14 Dec 2015 20:32:17 +0000 (21:32 +0100)] 
resolved: update DNSSEC TODO

8 years agoresolved: add basic proof of non-existance support for NSEC+NSEC3
Lennart Poettering [Mon, 14 Dec 2015 20:26:42 +0000 (21:26 +0100)] 
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.

8 years agoresolved: when serializing NSEC3 windows, don't write more windows than necessary
Lennart Poettering [Mon, 14 Dec 2015 20:26:15 +0000 (21:26 +0100)] 
resolved: when serializing NSEC3 windows, don't write more windows than necessary

8 years agoresolved: constify a parameter
Lennart Poettering [Mon, 14 Dec 2015 20:23:54 +0000 (21:23 +0100)] 
resolved: constify a parameter

8 years agoresolved: always consider NSEC/NSEC3 RRs as "primary"
Lennart Poettering [Mon, 14 Dec 2015 20:22:40 +0000 (21:22 +0100)] 
resolved: always consider NSEC/NSEC3 RRs as "primary"

It's not OK to drop these for our proof of non-existance checks.

8 years agoresolved: don't choke on NULL DNS transactions when determining query candidate state
Lennart Poettering [Mon, 14 Dec 2015 20:21:59 +0000 (21:21 +0100)] 
resolved: don't choke on NULL DNS transactions when determining query candidate state

8 years agoresolved: initialize libgcrypt before using it
Lennart Poettering [Mon, 14 Dec 2015 20:21:16 +0000 (21:21 +0100)] 
resolved: initialize libgcrypt before using it

8 years agoresolved: rework how we get the gcrypt digest algorithm ID from DNSSEC digest ids
Lennart Poettering [Mon, 14 Dec 2015 20:20:05 +0000 (21:20 +0100)] 
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.

8 years agoresolved: apparently not all names are used in canonical form for DNSSEC validation
Lennart Poettering [Fri, 11 Dec 2015 19:19:05 +0000 (20:19 +0100)] 
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.

8 years agoMerge pull request #2165 from torstehu/fix-typo2
Daniel Mack [Mon, 14 Dec 2015 15:31:25 +0000 (16:31 +0100)] 
Merge pull request #2165 from torstehu/fix-typo2

treewide: fix typos and indentation

8 years agotreewide: fix typos and indentation 2165/head
Torstein Husebø [Fri, 4 Dec 2015 07:03:59 +0000 (08:03 +0100)] 
treewide: fix typos and indentation

8 years agomanager: log log level changes uniformly 2157/head
Zbigniew Jędrzejewski-Szmek [Thu, 10 Dec 2015 02:29:38 +0000 (21:29 -0500)] 
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.

8 years agomanager: move status output change debug messages to set function
Zbigniew Jędrzejewski-Szmek [Tue, 8 Dec 2015 23:23:39 +0000 (18:23 -0500)] 
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.

8 years agoMerge pull request #2152 from evverx/respect-disable-tests
Daniel Mack [Sun, 13 Dec 2015 16:22:48 +0000 (17:22 +0100)] 
Merge pull request #2152 from evverx/respect-disable-tests

build-sys: fix --disable-tests

8 years agobuild-sys: fix --disable-tests 2152/head
Evgeny Vereshchagin [Sun, 13 Dec 2015 06:51:33 +0000 (06:51 +0000)] 
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
...

8 years agoMerge pull request #2148 from evverx/fix-enable-smack
Daniel Mack [Sat, 12 Dec 2015 13:03:52 +0000 (14:03 +0100)] 
Merge pull request #2148 from evverx/fix-enable-smack

build-sys: fix ./configure --enable-smack

8 years agobuild-sys: refactor `have_smack` detection 2148/head
Evgeny Vereshchagin [Sat, 12 Dec 2015 06:08:25 +0000 (06:08 +0000)] 
build-sys: refactor `have_smack` detection

8 years agobuild-sys: fix ./configure --enable-smack
Evgeny Vereshchagin [Sat, 12 Dec 2015 03:43:45 +0000 (03:43 +0000)] 
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)},
...

8 years agoMerge pull request #2143 from poettering/dnssec4
Tom Gundersen [Fri, 11 Dec 2015 17:38:14 +0000 (18:38 +0100)] 
Merge pull request #2143 from poettering/dnssec4

Another batch of DNSSEC fixes

8 years agoresolved: don't eat up errors 2143/head
Lennart Poettering [Fri, 11 Dec 2015 14:10:56 +0000 (15:10 +0100)] 
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.

8 years agoresolved: refactor DNSSEC answer validation
Lennart Poettering [Fri, 11 Dec 2015 13:00:08 +0000 (14:00 +0100)] 
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.

8 years agoresolved: rework dnssec validation results
Lennart Poettering [Fri, 11 Dec 2015 12:55:26 +0000 (13:55 +0100)] 
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".

8 years agoresolved: rework how and when the number of answer RRs to cache is determined
Lennart Poettering [Fri, 11 Dec 2015 12:36:25 +0000 (13:36 +0100)] 
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.

8 years agoresolved: generalize DNS RR type validity checks
Lennart Poettering [Thu, 10 Dec 2015 14:01:04 +0000 (15:01 +0100)] 
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.

8 years agoresolved: refuse OPT RRs in incoming packets that are not in the additional section
Lennart Poettering [Thu, 10 Dec 2015 12:46:53 +0000 (13:46 +0100)] 
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.

8 years agoresolved: refuse to cache ANY kind of pseudo-RR-type
Lennart Poettering [Thu, 10 Dec 2015 12:46:05 +0000 (13:46 +0100)] 
resolved: refuse to cache ANY kind of pseudo-RR-type

8 years agoresolved: no need to check for NULL explicitly before invoking dns_packet_unref()
Lennart Poettering [Thu, 10 Dec 2015 12:28:33 +0000 (13:28 +0100)] 
resolved: no need to check for NULL explicitly before invoking dns_packet_unref()

8 years agoresolved: extend list of pseudo RR types
Lennart Poettering [Thu, 10 Dec 2015 12:27:58 +0000 (13:27 +0100)] 
resolved: extend list of pseudo RR types

Also, explain the situation with a longer comment.

8 years agoMerge pull request #2096 from teg/resolved-cache
Daniel Mack [Thu, 10 Dec 2015 19:48:42 +0000 (20:48 +0100)] 
Merge pull request #2096 from teg/resolved-cache

Misc resolved cache fixes

8 years agoresolved: cache - only stringify RR keys when in debug mode 2096/head
Tom Gundersen [Thu, 10 Dec 2015 19:17:49 +0000 (20:17 +0100)] 
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.

8 years agoresolved: cache - don't flush the cache of mDNS records unneccesarily
Tom Gundersen [Thu, 10 Dec 2015 18:57:41 +0000 (19:57 +0100)] 
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 90325e8c2e559a21ef0bc2f26b844c140faf8020.

8 years agoTODO
Tom Gundersen [Thu, 10 Dec 2015 18:47:47 +0000 (19:47 +0100)] 
TODO

8 years agoMerge pull request #2133 from poettering/import-drop-dkr
Daniel Mack [Thu, 10 Dec 2015 16:40:39 +0000 (17:40 +0100)] 
Merge pull request #2133 from poettering/import-drop-dkr

importd: drop dkr support

8 years agoresolved: cache - rework which RR types we apply redirection to
Tom Gundersen [Thu, 3 Dec 2015 20:40:06 +0000 (21:40 +0100)] 
resolved: cache - rework which RR types we apply redirection to

The logic of dns_cache_get() is now:
 - look up the precise key;
 - look up NXDOMAIN item;
 - if an RR type that may be redirected
   (i.e., not CNAME, DNAME, RRSIG, NSEC, NSEC3, SIG, KEY, or
   NXT) look up a correpsonding CNAME or DNAME record;
 - look up a corresponding NSEC record;

Before this change we would give up before potentially finding
negative cache entries for DNAME, CNAME and NSEC records, we
would return NSEC records for aliases where we had DNAME or CNAME
records available and we would incorrectly try to redirect DNSSEC RRs.

8 years agoresolved: cache - improve logging
Tom Gundersen [Thu, 3 Dec 2015 20:26:19 +0000 (21:26 +0100)] 
resolved: cache - improve logging

Some DNS servers will hand out negative answers without SOA records,
these can not be cached, so log about that fact.

8 years agoresolved: cache - don't cache NXDOMAIN by TYPE
Tom Gundersen [Thu, 3 Dec 2015 18:53:35 +0000 (19:53 +0100)] 
resolved: cache - don't cache NXDOMAIN by TYPE

An NXDOMAIN entry means there are no RRs of any type for a name,
so only cache by CLASS + NAME, rather than CLASS + NAME + TYPE.

8 years agoresolved: cache - do negative caching only on the canonical name
Tom Gundersen [Wed, 2 Dec 2015 17:46:32 +0000 (18:46 +0100)] 
resolved: cache - do negative caching only on the canonical name

Apart from dropping redundant information, this fixes an issue
where, due to broken DNS servers, we can only be certain of whether
an apparent NODATA response is in fact an NXDOMAIN response after
explicitly resolving the canonical name. This issue is outlined in
RFC2308. Moreover, by caching NXDOMAIN for an existing name, we
would mistakenly return NXDOMAIN for types which should not be
redirected. I.e., a query for AAAA on test-nx-1.jklm.no correctly
returns NXDOMAIN, but a query for CNAME should return the record
and a query for DNAME should return NODATA.

Note that this means we will not cache an NXDOMAIN response in the
presence of redirection, meaning one redundant roundtrip in case the
name is queried again.

8 years agoMerge pull request #2134 from jorgenschaefer/detect-ipv6-with-sockstat6
Daniel Mack [Thu, 10 Dec 2015 15:54:57 +0000 (16:54 +0100)] 
Merge pull request #2134 from jorgenschaefer/detect-ipv6-with-sockstat6

Use /proc/net/sockstat6 to detect IPv6 support

8 years agoimportd: drop dkr support 2133/head
Lennart Poettering [Thu, 10 Dec 2015 11:40:04 +0000 (12:40 +0100)] 
importd: drop dkr support

The current code is not compatible with current dkr protocols anyway,
and dkr has a different focus ("microservices") than nspawn anyway
("whole machine containers"), hence drop support for it, we cannot
reasonably keep this up to date, and it creates the impression we'd
actually care for the microservices usecase.

8 years agoMerge pull request #2135 from zonque/resolved-mdns-3
Lennart Poettering [Thu, 10 Dec 2015 15:49:31 +0000 (16:49 +0100)] 
Merge pull request #2135 from zonque/resolved-mdns-3

resolved: more mDNS specific bits (3)

8 years agoresolved: make sure the packet's transaction ID is always 0 for mDNS 2135/head
Daniel Mack [Thu, 10 Dec 2015 14:59:30 +0000 (15:59 +0100)] 
resolved: make sure the packet's transaction ID is always 0 for mDNS

RFC6762, 18.1:

   In multicast query messages, the Query Identifier SHOULD be set to
   zero on transmission.

8 years agoresolved: discard any reply packet that contains a bogus name
Daniel Mack [Thu, 10 Dec 2015 15:08:43 +0000 (16:08 +0100)] 
resolved: discard any reply packet that contains a bogus name

Only .in-addr.arpa and .local are considered local in mDNS, so discard the
packet if anything else is thrown at us.

8 years agoMerge pull request #2129 from poettering/dnssec3
Tom Gundersen [Thu, 10 Dec 2015 14:22:18 +0000 (15:22 +0100)] 
Merge pull request #2129 from poettering/dnssec3

Third DNSSEC patch series

8 years agoUse /proc/net/sockstat6 to detect IPv6 support 2134/head
Jorgen Schaefer [Thu, 10 Dec 2015 12:24:45 +0000 (13:24 +0100)] 
Use /proc/net/sockstat6 to detect IPv6 support

The file /sys/module/ipv6 does not exist in all container
implementations (e.g. Virtuozzo). Using /proc/net/sockstat6
detects IPv6 support reliably in these environments, too.

This file does not exist when the kernel is not compiled with
IPv6 support, or if IPv6 support is disabled, so simply checking
for existence should be a suitable check.

Fixes #2059