1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00
Commit Graph

24390 Commits

Author SHA1 Message Date
Lennart Poettering
a9cb7caba6 Merge pull request #2381 from jsynacek/journalctl-colors-v4
basic/terminal-util: introduce SYSTEMD_COLORS environment variable
2016-01-20 13:44:31 +01:00
Tom Gundersen
f7e29f72bf Merge pull request #2372 from poettering/dnssec17
resolved bus API improvements
2016-01-20 11:30:20 +01:00
Jan Synacek
40c9fe4c08 basic/terminal-util: introduce SYSTEMD_COLORS environment variable
... to determine if color output should be enabled. If the variable is not set,
fall back to using on_tty(). Also, rewrite existing code to use
colors_enabled() where appropriate.
2016-01-20 10:12:41 +01:00
Lennart Poettering
c69fa7e3c4 resolved: rework DNSSECSupported property
Not only report whether the server actually supports DNSSEC, but also first check whether DNSSEC is actually enabled
for it in our local configuration.

Also, export a per-link DNSSECSupported property in addition to the existing manager-wide property.
2016-01-19 21:56:54 +01:00
Lennart Poettering
d2ec6608b9 resolved: add SetLinkXYZ() method counterparts on the Link object
So far, we exposed SetLinkXYZ() on the Manager interface, to set a couple of link properties. This adds similar calls
SetXYZ() on the Link interface, and makes sure the former is little more than a shortcut to the latter.

SetLinkXYZ() has the benefit of not requiring a GetLink() round trip for setting these properties, while the method
actually belongs to the Link objects, and this change corrects that.
2016-01-19 21:56:54 +01:00
Lennart Poettering
0645ce61a0 sd-resolve: use UINT64_C() macros where appropriate 2016-01-19 21:56:54 +01:00
Lennart Poettering
a7f6e7e847 networkd: sd_bus_path_decode() returns 0, if the prefix doesn't match 2016-01-19 21:56:54 +01:00
Lennart Poettering
fdb90ac6a6 networkd: optimize link_node_enumerator() a bit
strv_consume() is pretty expensive when invoked piecemeal, hence optimize it a bit by pre-allocating a properly sized
array.
2016-01-19 21:56:54 +01:00
Lennart Poettering
3abaabdab7 resolved: expose bus objects for each Link
The link objects expose as properties the current settings made with SetLinkDNS() and related calls, plus some more
information.
2016-01-19 21:56:54 +01:00
Daniel Mack
d619a0c4a5 Merge pull request #2373 from keszybz/man-api-build-3
Man page grammar and build tweaks v3
2016-01-19 20:44:58 +01:00
Lennart Poettering
e40f0647b4 resolved: rename a few props to closer match ther counterparts in the various configuration files 2016-01-19 18:37:45 +01:00
Lennart Poettering
97e5d693c0 resolved: add bus API for configuring per-link DNS settings
This is useful for alternative network management solutions (such as NetworkManager) to push DNS configuration data
into resolved.

The calls will fail should networkd already have taken possesion of a link, so that the bus API is only available if
we don't get the data from networkd.
2016-01-19 18:37:45 +01:00
Lennart Poettering
9a81c76848 resolved: add a couple of errors to the error mapping tables
These were previously forgotten, add them now.
2016-01-19 18:37:45 +01:00
Lennart Poettering
dfc1091b2f resolved: allocate DNS scope for links only if the interface is up
For mDNS and LLMNR we already created the scopes only if the specific interfaces where actually up and suitable for
Multicasting. Add a similar (but weaker) logic for unicast DNS as well.
2016-01-19 18:37:45 +01:00
Lennart Poettering
5b91184300 resolve-host: support --interface= as long form for -i 2016-01-19 18:37:45 +01:00
Lennart Poettering
593f665cd5 resolve-host: show whether DNSSEC is supported or not in --statistics output
This should be generally useful information, hence show it.
2016-01-19 18:37:45 +01:00
Lennart Poettering
786c8e9fbc resolve-host: also show mDNS as source of resolving 2016-01-19 18:37:45 +01:00
Zbigniew Jędrzejewski-Szmek
f23e83b156 man/sd_event_{add_io,add_time,add_signal,now}: various small fixes
- remove things which are clear from the context
- 0 is a valid descriptor number, hence "positive" → "non-negative"
- "positive" means greater than zero, hence "positive non-zero" → "positive"
- use oxford comma
- reword some things for clarity
2016-01-19 12:18:24 -05:00
Lennart Poettering
d555eb990b Merge pull request #2369 from zonque/resolved
resolved: hide public mDNS configuration knobs for now
2016-01-19 15:11:10 +01:00
Lennart Poettering
5f0f8d749d Merge pull request #2357 from keszybz/warnings-2
Remove gcc warnings v2
2016-01-19 15:09:53 +01:00
Daniel Mack
60402bdc52 resolved: remove configuration knobs for mDNS until it's ready
These bits were intenionally left out while mDNS is under development.

Remove the exposed knobs and man page entries again until this is settled.
2016-01-19 14:11:05 +01:00
Daniel Mack
b6c5d46b23 resolved: fix mDNS IPv6 multicast address
Fixes #2366
2016-01-19 14:11:05 +01:00
Tom Gundersen
bcbd1d0cd5 Merge pull request #2358 from poettering/dnssec16
sixteenth DNSSEC patch set
2016-01-19 01:44:20 +01:00
Lennart Poettering
cc450722a0 resolved: don't forget about lost OPT and RRSIG when downgrading a feature level
Certain Belkin routers appear to implement a broken DNS cache for A RRs and some others, but implement a pass-thru for
AAAA RRs. This has the effect that we quickly recognize the broken logic of the router when we do an A lookup, but for
AAAA everything works fine until we actually try to validate the request. Given that the validation will necessarily
fail ultimately let's make sure we remember even when downgrading a feature level that OPT or RRSIG was missing.
2016-01-19 00:51:26 +01:00
Lennart Poettering
f009fda92c update DNSSEC TODO 2016-01-18 23:31:29 +01:00
Lennart Poettering
e09f605eec resolved: don't try to print error strings, where errno isn't set 2016-01-18 23:31:29 +01:00
Lennart Poettering
4dd15077f3 resolved: when restarting a transaction pick a new ID
When we restart a transaction because of an incompatible server, pick a new transaction ID.

This should increase compatibility with DNS servers that don't like if they get different requests with the same
transaction ID.
2016-01-18 23:31:29 +01:00
Lennart Poettering
b214dc0f68 resolved: enforce maximum limit on DNS transactions
given that DNSSEC lookups may result in quite a number of auxiliary transactions, let's better be safe than sorry and
also enforce a limit on the number of total transactions, not just on the number of queries.
2016-01-18 23:31:29 +01:00
Lennart Poettering
8f4560c7b9 resolved: add DNAME test case to the complex DNSSEC test 2016-01-18 23:31:16 +01:00
Lennart Poettering
942eb2e71b resolved: fix how we detect whether auxiliary DNSSEC transactions are ready
Previously, when getting notified about a completed auxiliary DNSSEC transaction we'd immediately act on it, and
possibly abort the main transaction. This is problematic, as DNS transactions that already completed at the time we
started using them will never get the notification event, and hence never be acted on in the same way.

Hence, introduce a new call dns_transaction_dnssec_ready() that checks the state of auxiliary DNSSEC transactions, and
returns 1 when we are ready for the actual DNSSEC validation step. Then, make sure this is invoked when the auxiliary
transactions are first acquired (and thus possibly reused) as well when the notifications explained above take place.

This fixes problems particularly when doing combined A and AAAA lookups  where the auxiliary DNSSEC transactions get
reused between them, and where we got confused if we reused an auxiliary DNSSEC transaction from one when it already
got completed from the other.
2016-01-18 23:31:16 +01:00
Lennart Poettering
8ec76e6af5 resolved: end log messages in a full stop 2016-01-18 23:31:16 +01:00
Lennart Poettering
542e0c84d1 resolved: never consider following a CNAME/DNAME chain for a CNAME/DNAME lookup
Let's avoid thinking that a CNAME/DNAME chain traversal could be a good idea if QTYPE is already CNAME/DNAME.

(Also, let's bail out early when trying to see if some RR is a suitable CNAME/DNAME for some other RR).
2016-01-18 23:31:16 +01:00
Lennart Poettering
59a899908f resolved: when following a CNAME, turn off search domains
If the first step was done via a search domain, make sure the subsequent steps are not.
2016-01-18 23:31:16 +01:00
Lennart Poettering
7820b320ea resolved: properly reset old collected data when following a CNAME redirect 2016-01-18 23:31:16 +01:00
Lennart Poettering
12634bb4a9 resolved: beef up complex dnssec test to also use ResolveAddress() and do IDNA checks 2016-01-18 23:31:16 +01:00
Lennart Poettering
23b298bce7 resolved: rework IDNA logic
Move IDNA logic out of the normal domain name processing, and into the bus frontend calls. Previously whenever
comparing two domain names we'd implicitly do IDNA conversion so that "pöttering.de" and "xn--pttering-n4a.de" would be
considered equal. This is problematic not only for DNSSEC, but actually also against he IDNA specs.

Moreover it creates problems when encoding DNS-SD services in classic DNS. There, the specification suggests using
UTF8 encoding for the actual service name, but apply IDNA encoding to the domain suffix.

With this change IDNA conversion is done only:

- When the user passes a non-ASCII hostname when resolving a host name using ResolveHostname()
- When the user passes a non-ASCII domain suffix when resolving a service using ResolveService()

No IDNA encoding is done anymore:

- When the user does raw ResolveRecord() RR resolving
- On the service part of a DNS-SD service name

Previously, IDNA encoding was done when serializing names into packets, at a point where information whether something
is a label that needs IDNA encoding or not was not available, but at a point whether it was known whether to generate a
classic DNS packet (where IDNA applies), or an mDNS/LLMNR packet (where IDNA does not apply, and UTF8 is used instead
for all host names). With this change each DnsQuery object will now maintain two copies of the DnsQuestion to ask: one
encoded in IDNA for use with classic DNS, and one encoded in UTF8 for use with LLMNR and MulticastDNS.
2016-01-18 23:31:16 +01:00
Lennart Poettering
b6800689e0 resolved: minor optimization for dns_question_is_equal()
If the poinetrs are equal, we don't have to do a deep comparison.

This is similar to a similar optimization we already have in place for RRs and keys.
2016-01-18 23:31:16 +01:00
Lennart Poettering
0f7091e624 resolved: be slightly stricter when validating DnsQuestion
Also verify whether the DNS RR types are actually suitable for a question.
2016-01-18 23:31:16 +01:00
Lennart Poettering
6a21960c0b resolved: make key argument of dns_question_contains() const 2016-01-18 23:31:16 +01:00
Lennart Poettering
0cf40f5527 resolved add dns_name_apply_idna() to convert a domain name into its IDNA equivalent 2016-01-18 23:31:15 +01:00
Tom Gundersen
6228dc518f Merge pull request #2326 from poettering/dnssec15
Fifteenth batch of DNSSEC patches
2016-01-18 23:10:53 +01:00
Zbigniew Jędrzejewski-Szmek
ab6f56debf build-sys: allow building man pages even if disabled in ./configure
This is purely for developer convenience: building man pages is slow
so people tend to disable them when not working on documentation. But
sometimes it is useful to build the man page to look something up,
especially when working on an older machine which has outdated
documentation, or to test some change to documentation. The rules to build
man pages are now outside of the ENABLE_MANPAGES conditional, but they
are not used unless manually invoked, and only the inclusion of man
pages in build and install targets is affected by the conditional.

Also, more generated files are removed in clean, which seems to be
good thing, and Makefile.am is simplified.
2016-01-18 16:19:13 -05:00
Zbigniew Jędrzejewski-Szmek
b3b0c23a56 journal-remote: update to 64bit µhttp api, provide fallback
64 bit offset is now accepted, which is nice. The old function is
deprecated, and generates a compile time warning when used. We only
use an offset of 0, so we really don't care. Adapt to use the new
function, but fall back to the old one on older versions.
2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
ce7229a224 journal-remote: fix warning about deprecated µhttpd macro
src/journal-remote/journal-remote.c:590:13: warning: Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE
                 return mhd_respond(connection, MHD_HTTP_METHOD_NOT_ACCEPTABLE,
             ^

The new define was added in 0.9.38. Instead of requiring the new
libmicrohttpd version, provide the fallback, it is trivial.
2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
555f5cdc2d resolve: fix return value from dns_packet_append_rr() 2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
e5d7bce12d udevd: initialize fds to -1 and close them before exiting
Little change in practice, because the program will exit soon
afterwards, but the standard style of closing all fds is now followed.
Also gets rid of gcc warning about fd_ctrl and fd_uevent being
unitialized.
2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
ff82c36c79 journald: do not free uninitialized pointer in error path 2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
2adae5ac5d logind: simplify job variable handling
manager_{start,stop}_{slice,scope,unit} functions had an optional job
output parameter. But all callers specified job, so make the parameter
mandatory, add asserts. Also extract common job variable handling to
a helper function to avoid duplication.

Avoids gcc warning about job being unitialized.
2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
011062f3c0 logind: do not use an uninitialized variable
We requested various fields using SD_BUS_CREDS_AUGMENT but at least
sd_bus_creds_get_tty can fail with ENXIO, not setting the output variable.
2016-01-18 15:21:28 -05:00
Zbigniew Jędrzejewski-Szmek
90f604d128 sd-event: fix theoretical leak on error in event_make_signal_data 2016-01-18 15:21:28 -05:00