platform/upstream/systemd.git
8 years agoshared: port dns_name_compare_func() to make use of ascii_strcasecmp_nn()
Lennart Poettering [Wed, 13 Jan 2016 19:20:52 +0000 (20:20 +0100)]
shared: port dns_name_compare_func() to make use of ascii_strcasecmp_nn()

This way we become compatible with DNS names with embedded NUL bytes.

8 years agoshared: simplify dns_name_is_single_label() by using dns_name_parent() to skip first...
Lennart Poettering [Wed, 13 Jan 2016 18:51:09 +0000 (19:51 +0100)]
shared: simplify dns_name_is_single_label() by using dns_name_parent() to skip first label

8 years agobasic: add ascii_strcasecmp_nn() call
Lennart Poettering [Wed, 13 Jan 2016 18:45:05 +0000 (19:45 +0100)]
basic: add ascii_strcasecmp_nn() call

In contrast to ascii_strcasecmp_nn() it takes two character buffers with their individual length. It will then compare
the buffers up the smaller size of the two buffers, and finally the length themselves.

8 years agoshared: replace a few invocations of strcasecmp() for DNS labels with ascii_strcasecm...
Lennart Poettering [Wed, 13 Jan 2016 02:03:26 +0000 (03:03 +0100)]
shared: replace a few invocations of strcasecmp() for DNS labels with ascii_strcasecmp_n()

This makes our code compatible with embedded NUL bytes, as we don't care about NUL bytes anymore.

8 years agoresolved: implement the full NSEC and NSEC3 postive wildcard proofs
Lennart Poettering [Wed, 13 Jan 2016 01:45:28 +0000 (02:45 +0100)]
resolved: implement the full NSEC and NSEC3 postive wildcard proofs

8 years agoresolved: refuse validating wildcard RRs for SOA, NSEC3, DNAME
Lennart Poettering [Wed, 13 Jan 2016 01:29:31 +0000 (02:29 +0100)]
resolved: refuse validating wildcard RRs for SOA, NSEC3, DNAME

8 years agoresolved: properly handles RRs in domains beginning in an asterisk label
Lennart Poettering [Wed, 13 Jan 2016 01:26:23 +0000 (02:26 +0100)]
resolved: properly handles RRs in domains beginning in an asterisk label

Properly handle RRs that begin with an asterisk label. These are the unexpanded forms of wildcard domains and appear in
NSEC RRs for example. We need to make sure we handle the signatures of these RRs properly, since they mostly are
considered normal RRs, except that the RRSIG labels counter is one off for them, as the asterisk label is always
excluded of the signature.

8 years agoresolved: optimize dnssec_verify_rrset() a bit
Lennart Poettering [Wed, 13 Jan 2016 01:25:32 +0000 (02:25 +0100)]
resolved: optimize dnssec_verify_rrset() a bit

Let's determine the source of synthesis once instead of for each RR in the RRset.

8 years agoshared: add new dns_name_startswith() call
Lennart Poettering [Wed, 13 Jan 2016 01:23:08 +0000 (02:23 +0100)]
shared: add new dns_name_startswith() call

dns_name_startswith() is to dns_name_endswith() as startswith() is to endswith().

8 years agobasic: add new ascii_strcasecmp_n() call
Lennart Poettering [Wed, 13 Jan 2016 01:21:16 +0000 (02:21 +0100)]
basic: add new ascii_strcasecmp_n() call

8 years agosystemctl: improve wording of "systemctl enable" messages
Lennart Poettering [Wed, 13 Jan 2016 01:19:57 +0000 (02:19 +0100)]
systemctl: improve wording of "systemctl enable" messages

Closes: #2299

8 years agoresolved: allocate bounded strings on stack instead of heap, if we can
Lennart Poettering [Wed, 13 Jan 2016 01:14:20 +0000 (02:14 +0100)]
resolved: allocate bounded strings on stack instead of heap, if we can

8 years agoresolved: consider inverted RRSIG validity intervals expired
Lennart Poettering [Wed, 13 Jan 2016 00:04:03 +0000 (01:04 +0100)]
resolved: consider inverted RRSIG validity intervals expired

8 years agoupdate TODO
Lennart Poettering [Tue, 12 Jan 2016 21:14:49 +0000 (22:14 +0100)]
update TODO

8 years agoMerge pull request #2312 from jsynacek/master
Daniel Mack [Wed, 13 Jan 2016 12:29:33 +0000 (13:29 +0100)]
Merge pull request #2312 from jsynacek/master

man/tmpfiles.d: add note about permissions and ownership of symlinks

8 years agoman/tmpfiles.d: add note about permissions and ownership of symlinks
Jan Synacek [Wed, 13 Jan 2016 07:41:54 +0000 (08:41 +0100)]
man/tmpfiles.d: add note about permissions and ownership of symlinks

...because this is might not be obvious.

8 years agoMerge pull request #490 from pyssling/master
Lennart Poettering [Tue, 12 Jan 2016 22:30:20 +0000 (23:30 +0100)]
Merge pull request #490 from pyssling/master

Add machine-id setting

8 years agocore: Add machine-id setting
Nils Carlson [Sun, 5 Jul 2015 22:00:59 +0000 (00:00 +0200)]
core: Add machine-id setting

Allow for overriding all other machine-ids which may be present on
the system using a kernel command line systemd.machine_id or
--machine-id= option.

This is especially useful for network booted systems where the
machine-id needs to be static, or for containers where a specific
machine-id is wanted.

8 years agoMerge pull request #2131 from evverx/regenerate-m4-on-reconfigure
Lennart Poettering [Tue, 12 Jan 2016 19:35:55 +0000 (20:35 +0100)]
Merge pull request #2131 from evverx/regenerate-m4-on-reconfigure

build-sys: regenerate %.m4 -> % on reconfigure

8 years agoMerge pull request #2310 from vcaputo/sd-event-profiling-fixups
Lennart Poettering [Tue, 12 Jan 2016 18:45:01 +0000 (19:45 +0100)]
Merge pull request #2310 from vcaputo/sd-event-profiling-fixups

sd-event: minor fixups to delays profiling changes

8 years agosd-event: minor fixups to delays profiling changes
Vito Caputo [Tue, 12 Jan 2016 18:14:33 +0000 (10:14 -0800)]
sd-event: minor fixups to delays profiling changes

8 years agoMerge pull request #2147 from vcaputo/sd-event-measure-latencies
Lennart Poettering [Tue, 12 Jan 2016 17:52:30 +0000 (18:52 +0100)]
Merge pull request #2147 from vcaputo/sd-event-measure-latencies

sd-event: instrument sd_event_run() for profiling delays

8 years agosd-event: instrument sd_event_run() for profiling delays
Vito Caputo [Mon, 7 Dec 2015 19:28:18 +0000 (11:28 -0800)]
sd-event: instrument sd_event_run() for profiling delays

Set SD_EVENT_PROFILE_DELAYS to activate accounting and periodic logging
of the distribution of delays between sd_event_run() calls.

Time spent in dispatching as well as time spent outside of
sd_event_run() is measured and accounted for.  Every 5 seconds a
logarithmic histogram loop iteration delays since 5 seconds previous is
logged.

This is useful in identifying the frequency and magnitude of latencies
affecting the event loop, which should be kept to a minimum.

8 years agoMerge pull request #2308 from zonque/xsprintf
Lennart Poettering [Tue, 12 Jan 2016 15:03:48 +0000 (16:03 +0100)]
Merge pull request #2308 from zonque/xsprintf

tree-wide: use xsprintf() where applicable

8 years agotree-wide: use xsprintf() where applicable
Daniel Mack [Tue, 12 Jan 2016 14:34:20 +0000 (15:34 +0100)]
tree-wide: use xsprintf() where applicable

Also add a coccinelle receipt to help with such transitions.

8 years agoMerge pull request #2265 from ipuustin/ambient
Lennart Poettering [Tue, 12 Jan 2016 14:16:24 +0000 (15:16 +0100)]
Merge pull request #2265 from ipuustin/ambient

capabilities: added support for ambient capabilities.

8 years agoMerge pull request #2303 from aadamowski/fix-miscalculated-buffer
Daniel Mack [Tue, 12 Jan 2016 14:06:41 +0000 (15:06 +0100)]
Merge pull request #2303 from aadamowski/fix-miscalculated-buffer

Fix miscalculated buffer size and uses of size-unlimited sprintf()

8 years agoman: add AmbientCapabilities entry.
Ismo Puustinen [Mon, 11 Jan 2016 07:36:14 +0000 (09:36 +0200)]
man: add AmbientCapabilities entry.

8 years agotests: test ambient capabilities.
Ismo Puustinen [Tue, 5 Jan 2016 11:34:41 +0000 (13:34 +0200)]
tests: test ambient capabilities.

The ambient capability tests are only run if the kernel has support for
ambient capabilities.

8 years agocapabilities: added support for ambient capabilities.
Ismo Puustinen [Thu, 31 Dec 2015 12:54:44 +0000 (14:54 +0200)]
capabilities: added support for ambient capabilities.

This patch adds support for ambient capabilities in service files. The
idea with ambient capabilities is that the execed processes can run with
non-root user and get some inherited capabilities, without having any
need to add the capabilities to the executable file.

You need at least Linux 4.3 to use ambient capabilities. SecureBit
keep-caps is automatically added when you use ambient capabilities and
wish to change the user.

An example system service file might look like this:

[Unit]
Description=Service for testing caps

[Service]
ExecStart=/usr/bin/sleep 10000
User=nobody
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW

After starting the service it has these capabilities:

CapInh: 0000000000003000
CapPrm: 0000000000003000
CapEff: 0000000000003000
CapBnd: 0000003fffffffff
CapAmb: 0000000000003000

8 years agocapabilities: keep bounding set in non-inverted format.
Ismo Puustinen [Thu, 7 Jan 2016 22:00:04 +0000 (00:00 +0200)]
capabilities: keep bounding set in non-inverted format.

Change the capability bounding set parser and logic so that the bounding
set is kept as a positive set internally. This means that the set
reflects those capabilities that we want to keep instead of drop.

8 years agoMerge pull request #2290 from vcaputo/normalize-log-source-priorities
Lennart Poettering [Tue, 12 Jan 2016 01:03:23 +0000 (02:03 +0100)]
Merge pull request #2290 from vcaputo/normalize-log-source-priorities

journal: normalize priority of logging sources

8 years agoFix miscalculated buffer size and uses of size-unlimited sprintf()
Aleksander Adamowski [Mon, 11 Jan 2016 23:26:41 +0000 (15:26 -0800)]
Fix miscalculated buffer size and uses of size-unlimited sprintf()
function.

Not sure if this results in an exploitable buffer overflow, probably not
since the the int value is likely sanitized somewhere earlier and it's
being put through a bit mask shortly before being used.

8 years agoMerge pull request #2289 from poettering/dnssec13
Tom Gundersen [Mon, 11 Jan 2016 20:31:53 +0000 (21:31 +0100)]
Merge pull request #2289 from poettering/dnssec13

Thirteenth DNSSEC patch set

8 years agoresolved: improve query RR type error wording a bit
Lennart Poettering [Mon, 11 Jan 2016 19:19:10 +0000 (20:19 +0100)]
resolved: improve query RR type error wording a bit

8 years agoresolved: don#t allow explicit queries for RRSIG RRs
Lennart Poettering [Mon, 11 Jan 2016 19:15:28 +0000 (20:15 +0100)]
resolved: don#t allow explicit queries for RRSIG RRs

We wouldn't know how to validate them, since they are the signatures, and hence have no signatures.

8 years agoresolved: refuse doing queries for known-obsolete RR types
Lennart Poettering [Mon, 11 Jan 2016 19:05:29 +0000 (20:05 +0100)]
resolved: refuse doing queries for known-obsolete RR types

Given how fragile DNS servers are with some DNS types, and given that we really should avoid confusing them with
known-weird lookups, refuse doing lookups for known-obsolete RR types.

8 years agoresolved: rename DnsTransaction's current_features field to current_feature_level
Lennart Poettering [Mon, 11 Jan 2016 18:38:25 +0000 (19:38 +0100)]
resolved: rename DnsTransaction's current_features field to current_feature_level

This is a follow-up for f4461e5641d53f27d6e76e0607bdaa9c0c58c1f6.

8 years agoresolved: split out resetting of DNS server counters into a function call of its own
Lennart Poettering [Mon, 11 Jan 2016 17:57:59 +0000 (18:57 +0100)]
resolved: split out resetting of DNS server counters into a function call of its own

A suggested by Vito Caputo:

https://github.com/systemd/systemd/pull/2289#discussion-diff-49276220

8 years agoresolved: accept rightfully unsigned NSEC responses
Lennart Poettering [Sun, 10 Jan 2016 22:02:52 +0000 (23:02 +0100)]
resolved: accept rightfully unsigned NSEC responses

8 years agoresolved: rework how and when we detect whether our chosen DNS server knows DNSSEC
Lennart Poettering [Sun, 10 Jan 2016 21:58:58 +0000 (22:58 +0100)]
resolved: rework how and when we detect whether our chosen DNS server knows DNSSEC

Move detection into a set of new functions, that check whether one specific server can do DNSSEC, whether a server and
a specific transaction can do DNSSEC, or whether a transaction and all its auxiliary transactions could do so.

Also, do these checks both before we acquire additional RRs for the validation (so that we can skip them if the server
doesn't do DNSSEC anyway), and after we acquired them all (to see if any of the lookups changed our opinion about the
servers).

THis also tightens the checks a bit: a server that lacks TCP support is considered incompatible with DNSSEC too.

8 years agoresolved: cache formatted server string in DnsServer structure
Lennart Poettering [Fri, 8 Jan 2016 19:59:03 +0000 (20:59 +0100)]
resolved: cache formatted server string in DnsServer structure

This makes it easier to log information about a specific DnsServer object.

8 years agoresolved: rework server feature level logic
Lennart Poettering [Fri, 8 Jan 2016 17:50:41 +0000 (18:50 +0100)]
resolved: rework server feature level logic

This changes the DnsServer logic to count failed UDP and TCP failures separately. This is useful so that we don't end
up downgrading the feature level from one UDP level to a lower UDP level just because a TCP connection we did because
of a TC response failed.

This also adds accounting of truncated packets. If we detect incoming truncated packets, and count too many failed TCP
connections (which is the normal fall back if we get a trucnated UDP packet) we downgrade the feature level, given that
the responses at the current levels don't get through, and we somehow need to make sure they become smaller, which they
will do if we don't request DNSSEC or EDNS support.

This makes resolved work much better with crappy DNS servers that do not implement TCP and only limited UDP packet
sizes, but otherwise support DNSSEC RRs. They end up choking on the generally larger DNSSEC RRs and there's no way to
retrieve the full data.

8 years agoresolved: add missing case to switch statement
Lennart Poettering [Fri, 8 Jan 2016 17:50:15 +0000 (18:50 +0100)]
resolved: add missing case to switch statement

8 years agoresolved: log why we use TCP when UDP isn't supported by a server
Lennart Poettering [Fri, 8 Jan 2016 16:18:54 +0000 (17:18 +0100)]
resolved: log why we use TCP when UDP isn't supported by a server

8 years agoresolved: log about truncated replies before trying again, not after
Lennart Poettering [Fri, 8 Jan 2016 16:16:32 +0000 (17:16 +0100)]
resolved: log about truncated replies before trying again, not after

8 years agoresolved: don't attempt to send queries for DNSSEC RR types to servers not supporting...
Lennart Poettering [Fri, 8 Jan 2016 16:10:49 +0000 (17:10 +0100)]
resolved: don't attempt to send queries for DNSSEC RR types to servers not supporting them

If we already degraded the feature level below DO don't bother with sending requests for DS, DNSKEY, RRSIG, NSEC, NSEC3
or NSEC3PARAM RRs. After all, we cannot do DNSSEC validation then anyway, and we better not press a legacy server like
this with such modern concepts.

This also has the benefit that when we try to validate a response we received using DNSSEC, and we detect a limited
server support level while doing so, all further auxiliary DNSSEC queries will fail right-away.

8 years agoresolved: log about reasons for switching to TCP
Lennart Poettering [Fri, 8 Jan 2016 15:17:43 +0000 (16:17 +0100)]
resolved: log about reasons for switching to TCP

8 years agoresolved: when we get a packet failure from a server, don't downgrade UDP to TCP...
Lennart Poettering [Fri, 8 Jan 2016 01:46:59 +0000 (02:46 +0100)]
resolved: when we get a packet failure from a server, don't downgrade UDP to TCP or vice versa

Under the assumption that packet failures (i.e. FORMERR, SERVFAIL, NOTIMP) are caused by packet contents, not used
transport, we shouldn't switch between UDP and TCP when we get them, but only downgrade the higher levels down to UDP.

8 years agoresolved: properly handle UDP ICMP errors as lost packets
Lennart Poettering [Fri, 8 Jan 2016 01:38:00 +0000 (02:38 +0100)]
resolved: properly handle UDP ICMP errors as lost packets

UDP ICMP errors are reported to us via recvmsg() when we read a reply. Handle this properly, and consider this a lost
packet, and retry the connection.

This also adds some additional logging for invalid incoming packets.

8 years agoresolved: when we get a TCP connection failure, try again
Lennart Poettering [Fri, 8 Jan 2016 01:33:54 +0000 (02:33 +0100)]
resolved: when we get a TCP connection failure, try again

Previously, when we couldn't connect to a DNS server via TCP we'd abort the whole transaction using a
"connection-failure" state. This change removes that, and counts failed connections as "lost packet" events, so that
we switch back to the UDP protocol again.

8 years agoresolved: when DNS/TCP doesn't work, try DNS/UDP again
Lennart Poettering [Fri, 8 Jan 2016 01:29:02 +0000 (02:29 +0100)]
resolved: when DNS/TCP doesn't work, try DNS/UDP again

If we failed to contact a DNS server via TCP, bump of the feature level to UDP again. This way we'll switch back
between UDP and TCP if we fail to contact a host.

Generally, we prefer UDP over TCP, which is why UDP is a higher feature level. But some servers only support UDP but
not TCP hence when reaching the lowest feature level of TCP and want to downgrade from there, pick UDP again. We this
keep downgrading until we reach TCP and then we cycle through UDP and TCP.

8 years agoresolved: introduce dns_transaction_retry() and use it everywhere
Lennart Poettering [Fri, 8 Jan 2016 01:26:53 +0000 (02:26 +0100)]
resolved: introduce dns_transaction_retry() and use it everywhere

The code to retry transactions has been used over and over again, simplify it by replacing it by a new function.

8 years agoresolved: set a description on all our event sources
Lennart Poettering [Fri, 8 Jan 2016 01:20:39 +0000 (02:20 +0100)]
resolved: set a description on all our event sources

8 years agoresolved: fix error propagation
Lennart Poettering [Fri, 8 Jan 2016 01:19:43 +0000 (02:19 +0100)]
resolved: fix error propagation

8 years agoshared: make sure foo.bar and foobar result in different domain name hashes
Lennart Poettering [Fri, 8 Jan 2016 00:11:55 +0000 (01:11 +0100)]
shared: make sure foo.bar and foobar result in different domain name hashes

This also introduces a new macro siphash24_compress_byte() which is useful to add a single byte into the hash stream,
and ports one user over to it.

8 years agobasic: split hash functions into their own header files
Lennart Poettering [Fri, 8 Jan 2016 00:10:45 +0000 (01:10 +0100)]
basic: split hash functions into their own header files

The hash operations are not really that specific to hashmaps, hence split them into a .c module of their own.

8 years agoeditors: specify fill column
Lennart Poettering [Thu, 7 Jan 2016 23:24:06 +0000 (00:24 +0100)]
editors: specify fill column

Let's be a bit more precise with the editor configuration and specify a higher fill column of 119. This isn't as emacs'
default of 70, but also not particularly high on today's screens.

While we are at it, also set a couple of other emacs C coding style variables.

8 years agoresolved: properly look for NSEC/NSEC3 RRs when getting a positive wildcard response
Lennart Poettering [Thu, 7 Jan 2016 21:27:33 +0000 (22:27 +0100)]
resolved: properly look for NSEC/NSEC3 RRs when getting a positive wildcard response

This implements RFC 5155, Section 8.8 and RFC 4035, Section 5.3.4:

When we receive a response with an RRset generated from a wildcard we
need to look for one NSEC/NSEC3 RR that proves that there's no explicit RR
around before we accept the wildcard RRset as response.

This patch does a couple of things: the validation calls will now
identify wildcard signatures for us, and let us know the RRSIG used (so
that the RRSIG's signer field let's us know what the wildcard was that
generate the entry). Moreover, when iterating trough the RRsets of a
response we now employ three phases instead of just two.

a) in the first phase we only look for DNSKEYs RRs
b) in the second phase we only look for NSEC RRs
c) in the third phase we look for all kinds of RRs

Phase a) is necessary, since DNSKEYs "unlock" more signatures for us,
hence we shouldn't assume a key is missing until all DNSKEY RRs have
been processed.

Phase b) is necessary since NSECs need to be validated before we can
validate wildcard RRs due to the logic explained above.

Phase c) validates everything else. This phase also handles RRsets that
cannot be fully validated and removes them or lets the transaction fail.

8 years agoresolved: split up nsec3_hashed_domain() into two calls
Lennart Poettering [Thu, 7 Jan 2016 21:22:41 +0000 (22:22 +0100)]
resolved: split up nsec3_hashed_domain() into two calls

There's now nsec3_hashed_domain_format() and nsec3_hashed_domain_make().
The former takes a hash value and formats it as domain, the latter takes
a domain name, hashes it and then invokes nsec3_hashed_domain_format().

This way we can reuse more code, as the formatting logic can be unified
between this call and another place.

8 years agoresolved: drop flags unused parameter from nsec3_is_good
Lennart Poettering [Thu, 7 Jan 2016 21:19:12 +0000 (22:19 +0100)]
resolved: drop flags unused parameter from nsec3_is_good

8 years agoresolved: when validating, first strip revoked trust anchor keys from validated keys...
Lennart Poettering [Thu, 7 Jan 2016 19:33:31 +0000 (20:33 +0100)]
resolved: when validating, first strip revoked trust anchor keys from validated keys list

When validating a transaction we initially collect DNSKEY, DS, SOA RRs
in the "validated_keys" list, that we need for the proofs. This includes
DNSKEY and DS data from our trust anchor database. Quite possibly we
learn that some of these DNSKEY/DS RRs have been revoked between the
time we request and collect those additional RRs and we begin the
validation step. In this case we need to make sure that the respective
DS/DNSKEY RRs are removed again from our list. This patch adds that, and
strips known revoked trust anchor RRs from the validated list before we
begin the actual validation proof, and each time we add more DNSKEY
material to it while we are doing the proof.

8 years agoshared: simplify dns_name_hash_func() end of name detection
Lennart Poettering [Thu, 7 Jan 2016 19:07:44 +0000 (20:07 +0100)]
shared: simplify dns_name_hash_func() end of name detection

8 years agoresolved: make sure domain name hash function deals nicely with NUL embedded in labels
Lennart Poettering [Thu, 7 Jan 2016 18:43:56 +0000 (19:43 +0100)]
resolved: make sure domain name hash function deals nicely with NUL embedded in labels

8 years agobasic: introduce generic ascii_strlower_n() call and make use of it everywhere
Lennart Poettering [Thu, 7 Jan 2016 18:43:26 +0000 (19:43 +0100)]
basic: introduce generic ascii_strlower_n() call and make use of it everywhere

8 years agoresolved: rework trust anchor revoke checking
Lennart Poettering [Thu, 7 Jan 2016 16:03:31 +0000 (17:03 +0100)]
resolved: rework trust anchor revoke checking

Instead of first iterating through all DNSKEYs in the DnsAnswer in
dns_transaction_check_revoked_trust_anchors(), and
then doing that a second time in dns_trust_anchor_check_revoked(), do so
only once in the former, and pass the dnskey we found directly to the
latter.

8 years agoresolved: look for revoked trust anchors before validating a message
Lennart Poettering [Thu, 7 Jan 2016 11:56:38 +0000 (12:56 +0100)]
resolved: look for revoked trust anchors before validating a message

There's not reason to wait for checking for revoked trust anchors until
after validation, after all revoked DNSKEYs only need to be self-signed,
but not have a full trust chain.

This way, we can be sure that all trust anchor lookups we do during
validation already honour that some keys might have been revoked.

8 years agoresolved: use dns_answer_size() where appropriate to handle NULL DnsAnswer
Lennart Poettering [Thu, 7 Jan 2016 11:47:07 +0000 (12:47 +0100)]
resolved: use dns_answer_size() where appropriate to handle NULL DnsAnswer

8 years agoresolved: remove one level of indentation in dns_transaction_validate_dnssec()
Lennart Poettering [Thu, 7 Jan 2016 11:45:38 +0000 (12:45 +0100)]
resolved: remove one level of indentation in dns_transaction_validate_dnssec()

Invert an "if" check, so that we can use "continue" rather than another
code block indentation.

8 years agoresolved: be less strict where the OPT pseudo-RR is placed
Lennart Poettering [Thu, 7 Jan 2016 11:42:48 +0000 (12:42 +0100)]
resolved: be less strict where the OPT pseudo-RR is placed

This increases compatibility with crappy Belkin routers.

8 years agoresolved: rename suffix_rr → zone_rr
Lennart Poettering [Thu, 7 Jan 2016 11:40:59 +0000 (12:40 +0100)]
resolved: rename suffix_rr → zone_rr

The domain name for this NSEC3 RR was originally stored in a variable
called "suffix", which was then renamed to "zone" in
d1511b3338f431de3c95a50a9c1aca297e0c0734. Hence also rename the
RR variable accordingly.

8 years agoresolved: fix NSEC3 iterations limit to what RFC5155 suggests
Lennart Poettering [Thu, 7 Jan 2016 00:21:00 +0000 (01:21 +0100)]
resolved: fix NSEC3 iterations limit to what RFC5155 suggests

8 years agoMerge pull request #2262 from pohly/smack-network
Lennart Poettering [Mon, 11 Jan 2016 16:30:15 +0000 (17:30 +0100)]
Merge pull request #2262 from pohly/smack-network

smack: Handling network

8 years agoMerge pull request #2301 from martinpitt/kmod-static-condition
Lennart Poettering [Mon, 11 Jan 2016 16:26:30 +0000 (17:26 +0100)]
Merge pull request #2301 from martinpitt/kmod-static-condition

kmod-static-nodes: don't run if module list is empty

8 years agoMerge pull request #2302 from arthur-c/master
Daniel Mack [Mon, 11 Jan 2016 15:56:22 +0000 (16:56 +0100)]
Merge pull request #2302 from arthur-c/master

doc typo, src: systemd/src/journal-remote/journal-gatewayd.c

8 years agoMerge pull request #2294 from zonque/in_set
Lennart Poettering [Mon, 11 Jan 2016 15:45:26 +0000 (16:45 +0100)]
Merge pull request #2294 from zonque/in_set

macro.h: improve IN_SET helper macro

8 years agodoc typo, src: systemd/src/journal-remote/journal-gatewayd.c
Arthur Clement [Mon, 11 Jan 2016 15:38:35 +0000 (16:38 +0100)]
doc typo, src: systemd/src/journal-remote/journal-gatewayd.c

8 years agokmod-static-nodes: don't run if module list is empty
Martin Pitt [Mon, 11 Jan 2016 15:26:17 +0000 (16:26 +0100)]
kmod-static-nodes: don't run if module list is empty

With this kmod commit, modules.devname will be empty by default instead of
containing just a comment:

  https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=4c30a11d5f

Refine the startup condition of kmod-static-nodes.service to not run needlessly
if the list is empty.

8 years agoMerge pull request #2293 from zonque/issue-2292
Tom Gundersen [Mon, 11 Jan 2016 12:17:15 +0000 (13:17 +0100)]
Merge pull request #2293 from zonque/issue-2292

sd-netlink: fix assert

8 years agoMerge pull request #2296 from dankor/master
Daniel Mack [Mon, 11 Jan 2016 12:13:25 +0000 (13:13 +0100)]
Merge pull request #2296 from dankor/master

Updated Ukrainian translation

8 years agoUpdated Ukrainian translation
Daniel Korostil [Mon, 11 Jan 2016 11:55:48 +0000 (13:55 +0200)]
Updated Ukrainian translation

8 years agomacro.h: provide a switch-case statement generator for IN_SET
Daniel Mack [Sun, 10 Jan 2016 17:11:22 +0000 (18:11 +0100)]
macro.h: provide a switch-case statement generator for IN_SET

Rather than walking a list of valid values one-by-one, generate a
switch-case statement for the IN_SET() macro. This allows the compiler to
further optimize its code output, possibly by generating jump tables.
This effectively decreases the binary size slightly.

The implementation is based on macro overloading depending on the number of
arguments. h/t to the following post:

  https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments

8 years agosmack: Handling network
Casey Schaufler [Fri, 8 Nov 2013 17:42:26 +0000 (09:42 -0800)]
smack: Handling network

- Set Smack ambient to match run label
- Set Smack netlabel host rules

Set Smack ambient to match run label
------------------------------------
Set the Smack networking ambient label to match the
run label of systemd. System services may expect to
communicate with external services over IP. Setting
the ambient label assigns that label to IP packets
that do not include CIPSO headers. This allows systemd
and the services it spawns access to unlabeled IP
packets, and hence external services.

A system may choose to restrict network access to
particular services later in the startup process.
This is easily done by resetting the ambient label
elsewhere.

Set Smack netlabel host rules
-----------------------------
If SMACK_RUN_LABEL is defined set all other hosts to be
single label hosts at the specified label. Set the loopback
address to be a CIPSO host.

If any netlabel host rules are defined in /etc/smack/netlabel.d
install them into the smackfs netlabel interface.

[Patrick Ohly: copied from https://review.tizen.org/git/?p=platform/upstream/systemd.git;a=commit;h=db4f6c9a074644aa2bf]
[Patrick Ohly: adapt to write_string_file() change in "fileio: consolidate write_string_file*()"]
[Patrick Ohly: create write_netlabel_rules() based on the original write_rules() that was removed in "smack: support smack access change-rule"]
[Patrick Ohly: adapted to upstream code review feedback: error logging, string constants]

8 years agotree-wide: unify argument lists of IN_SET()
Daniel Mack [Sun, 10 Jan 2016 17:10:08 +0000 (18:10 +0100)]
tree-wide: unify argument lists of IN_SET()

The new implementation will not allow passing the same values more than
once, so clean up first.

8 years agosd-netlink: fix assert
Daniel Mack [Sun, 10 Jan 2016 14:36:03 +0000 (15:36 +0100)]
sd-netlink: fix assert

nl->fd can be 0.

8 years agojournal: normalize priority of logging sources
Vito Caputo [Fri, 8 Jan 2016 20:11:44 +0000 (12:11 -0800)]
journal: normalize priority of logging sources

The stream event source has a priority of SD_EVENT_PRIORITY_NORMAL+5,
and stdout source +10, but the native and syslog event sources are left
at the default of 0.

As a result, any heavy native or syslog logger can cause starvation of
the other loggers.  This is trivially demonstrated by running:

 dd if=/dev/urandom bs=8k | od | systemd-cat & # native spammer
 systemd-run echo hello & # stream logger
 journalctl --follow --output=verbose --no-pager --identifier=echo &

... and wait, and wait, the "hello" never comes.

Now kill %1, "hello" arrives finally.

8 years agoMerge pull request #2287 from dandedrick/journal-gatewayd-timeout-fix
Daniel Mack [Fri, 8 Jan 2016 08:25:21 +0000 (09:25 +0100)]
Merge pull request #2287 from dandedrick/journal-gatewayd-timeout-fix

journal-gatewayd: timeout journal wait to allow thread cleanup

8 years agoMerge pull request #2285 from evverx/fix-test-resolve
Daniel Mack [Thu, 7 Jan 2016 16:40:42 +0000 (17:40 +0100)]
Merge pull request #2285 from evverx/fix-test-resolve

tests: test-resolve: wait until all queries are completed

8 years agoMerge pull request #2284 from teg/resolved-cname-2
Lennart Poettering [Thu, 7 Jan 2016 15:13:14 +0000 (16:13 +0100)]
Merge pull request #2284 from teg/resolved-cname-2

resolved: query_process_cname - make fully recursive

8 years agotests: test-resolve: wait until all queries are completed
Evgeny Vereshchagin [Thu, 7 Jan 2016 14:03:05 +0000 (14:03 +0000)]
tests: test-resolve: wait until all queries are completed

This is a follow-up for 4a134c4903dbf6ef6c6a

Fixes:

$ ./test-resolve
209.132.183.105:80
209.132.183.105:80
canonical name: n/a
193.99.144.85:0
[2a02:2e0:3fe:1001:7777:772e:2:85]:0
canonical name: www.heise.de
Host: web.heise.de -- Serv: http

$ ./test-resolve
193.99.144.85:0
[2a02:2e0:3fe:1001:7777:772e:2:85]:0
canonical name: www.heise.de
Host: web.heise.de -- Serv: http

$ ./test-resolve
...

8 years agoMerge pull request #2276 from poettering/dnssec12
Tom Gundersen [Thu, 7 Jan 2016 14:05:58 +0000 (15:05 +0100)]
Merge pull request #2276 from poettering/dnssec12

Twelfth DNSSEC PR

8 years agoresolved: query_process_cname - make fully recursive
Tom Gundersen [Tue, 5 Jan 2016 16:56:45 +0000 (17:56 +0100)]
resolved: query_process_cname - make fully recursive

This ensures we properly resolve the CNAME chain as far as we can, rather
than only CNAME chains of length one.

8 years agoMerge pull request #2283 from evverx/update-valgrind-tests
Daniel Mack [Thu, 7 Jan 2016 11:02:38 +0000 (12:02 +0100)]
Merge pull request #2283 from evverx/update-valgrind-tests

build-sys: valgrind-tests: exclude python scripts too

8 years agobuild-sys: valgrind-tests: exclude python scripts too
Evgeny Vereshchagin [Thu, 7 Jan 2016 10:01:45 +0000 (10:01 +0000)]
build-sys: valgrind-tests: exclude python scripts too

8 years agoupdate DNSSEC TODO
Lennart Poettering [Wed, 6 Jan 2016 17:39:08 +0000 (18:39 +0100)]
update DNSSEC TODO

8 years agoresolved: introduce support for per-interface negative trust anchors
Lennart Poettering [Wed, 6 Jan 2016 17:36:32 +0000 (18:36 +0100)]
resolved: introduce support for per-interface negative trust anchors

8 years agonspawn: fix two typos in error messages
Daniel Mack [Wed, 6 Jan 2016 13:56:14 +0000 (14:56 +0100)]
nspawn: fix two typos in error messages

On errors, mention the functions that really failed.

8 years agoMerge pull request #2137 from fbuihuu/fstab-gen-fix-device-timeout
Daniel Mack [Wed, 6 Jan 2016 12:53:29 +0000 (13:53 +0100)]
Merge pull request #2137 from fbuihuu/fstab-gen-fix-device-timeout

Fstab gen fix device timeout

8 years agoMerge pull request #2261 from evverx/fix-test-rlimit-util
Daniel Mack [Wed, 6 Jan 2016 12:36:15 +0000 (13:36 +0100)]
Merge pull request #2261 from evverx/fix-test-rlimit-util

tests: don't change hard limit in test-rlimit-util

8 years agoMerge pull request #2243 from evverx/add-regression-test-for-journald-restart
Daniel Mack [Wed, 6 Jan 2016 11:56:56 +0000 (12:56 +0100)]
Merge pull request #2243 from evverx/add-regression-test-for-journald-restart

tests: add regression test for `systemctl restart systemd-journald`