Commit Graph

21589 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 72f6e560ac
Merge pull request #9791 from poettering/user-runtime-dir-fixes
user-runtime-dir@.service fixes
2018-08-03 13:32:01 +02:00
Lennart Poettering 3a13442bbf user-runtime-dir: downgrade a few log messages to LOG_DEBUG that we ignore
As the comments already say it might be quite likely that
$XDG_RUNTIME_DIR is not set up as mount, and we shouldn't complain about
that.

Moreover, let's make this idempotent, so that a runtime dir that is
already gone and is removed again doesn't cause failure.
2018-08-03 10:38:49 +02:00
Yu Watanabe 8e740110df resolve: openssl: make dnstls_stream_{write,read}() may return zero 2018-08-03 07:19:01 +09:00
Yu Watanabe 8eadd29183 resolve: fix error handling of SSL_shutdown() 2018-08-03 07:18:08 +09:00
Yu Watanabe 36f1946c73 resolve: fix typo and coding style cleanups 2018-08-03 06:29:38 +09:00
Yu Watanabe 59c3fee2c7 resolve: clear error queue before calling SSL_*() 2018-08-03 06:26:58 +09:00
Lennart Poettering 27d4866ad8
Merge pull request #9776 from keszybz/sd-bus-docs
More man pages for sd-bus and related changes
2018-08-02 17:07:03 +02:00
Yu Watanabe 99521cab77 resolve: fix error handling of dns_stream_read() 2018-08-02 17:06:32 +02:00
Zbigniew Jędrzejewski-Szmek 3d51a011f1 sd-bus: verify destination and sender values when setting
We would verify destination e.g. in sd_bus_message_new_call, but allow setting
any value later on with sd_bus_message_set_destination. I assume this check was
omitted not on purpose.
2018-08-02 15:49:45 +02:00
Yu Watanabe 2357724699 basic: use FAMILY_ADDRESS_SIZE() macro in hash_ops for in_addr_data 2018-08-02 17:07:25 +09:00
Yu Watanabe ca52812a94 network: make compare functions safe
As the variable 'line' is unsigned.
2018-08-02 17:06:03 +09:00
Zbigniew Jędrzejewski-Szmek 5b316330be
Merge pull request #9624 from poettering/service-state-flush
flush out ExecStatus structures when a new service cycle begins
2018-08-02 09:50:39 +02:00
Yu Watanabe 5bad7ebdda network: add more log messages in configuring DHCP6 client 2018-08-02 08:37:18 +02:00
Yu Watanabe 1f6860d984 network: add more log messages in configuring DHCP4 client 2018-08-02 08:37:18 +02:00
Yu Watanabe 5e5420d1a1
Merge pull request #9770 from keszybz/etc-resolved-no-address
Slightly more efficient handling of /etc/hosts blacklist entries
2018-08-02 12:54:50 +09:00
Zbigniew Jędrzejewski-Szmek be19cdf31c resolved: change error handling for manager_etc_hosts_read()
The choice what errors to ignore is left to the caller, and the caller is
changed to ignore all errors.

On error, previously read data is kept. So if e.g. an oom error happens, we
will continue to return slightly stale data instead of pretending we have no
entries for the given address. I think that's better, for example when
/etc/hosts contains some important overrides that external DNS should not be
queried for.
2018-08-01 12:45:54 +02:00
Zbigniew Jędrzejewski-Szmek fd373593ba resolved: keep addresses mapped to ::0 in a separate set
We'd store every 0.0.0.0 and ::0 entry as a structure without any addresses
allocated. This is a somewhat common use case, let's optimize it a bit.

This gives some memory savings and a bit faster response time too:
'time build/test-resolved-etc-hosts hosts' goes from 7.7s to 5.6s, and
memory use as reported by valgrind for ~10000 hosts is reduced
==18097==   total heap usage: 29,902 allocs, 29,902 frees, 2,136,437 bytes allocated
==18240==   total heap usage: 19,955 allocs, 19,955 frees, 1,556,021 bytes allocated

Also rename 'suppress' to 'found' (with reverse meaning). I think this makes
the intent clearer.
2018-08-01 12:38:39 +02:00
Zbigniew Jędrzejewski-Szmek 78fc21a11a test-resolved-etc-hosts: add tests for /etc/hosts parsing
Calling 'build/test-resolved-etc-hosts filename' parses just that file.
This is useful to test against https://hosts.ubuntu101.co.za/hosts.
2018-08-01 12:38:39 +02:00
Zbigniew Jędrzejewski-Szmek 37b7cc8d9a resolved: put /etc/hosts hashmaps in a structure and pass that around
This hides the details of juggling the two hashmaps from the callers a bit.
It also makes memory management a bit easier, because those two hashmaps share
some strings, so we can only free them together.

etc_hosts_parse() is made responsible to free the half-filled data structures
on error, which makes the caller a bit simpler.

No functional change. A refactoring to prepare for later changes.
2018-08-01 12:38:34 +02:00
Zbigniew Jędrzejewski-Szmek 8d732e2f71 test-nss-files: simplify module name handling
- drop compatibility with autotools (/.libs/ directory)
- don't special-case "libnss_dns", just try build/libnss_foo.so.2 and libnss_foo.so.2.
  This makes it possible to call e.g. build/test-nss files google.com.
2018-07-31 19:37:49 +02:00
Zbigniew Jędrzejewski-Szmek 5a8b164092 meson: drop parens when appending to list
Meson does not care either way, so let's use the simpler syntax. And files()
already gives a list, so nesting this in a list wouldn't be necessary even
if meson did not flatten everything.
2018-07-31 21:02:01 +09:00
Lennart Poettering 48e0e10ff5
Merge pull request #9760 from yuwata/resolve-etc-hosts-cleanup
resolve: several cleanups of handing /etc/hosts
2018-07-31 10:52:34 +02:00
Evgeni Golov eefe36e64c udev: net_id: document predictable names for SR-IOV virtual devices 2018-07-31 16:41:32 +09:00
Yu Watanabe 7bf8c3ded4 resolve: support address with ifname in /etc/hosts 2018-07-31 16:12:13 +09:00
Yu Watanabe 0351eb1148 resolve: use in_addr_data type for storing address 2018-07-31 15:46:28 +09:00
Yu Watanabe 6c39e02609 basic: introduce in_addr_data_hash_ops 2018-07-31 15:45:38 +09:00
Lennart Poettering f6f8a1aee0
Merge pull request #9734 from irtimmer/feature/dns-over-tls-openssl
resolved: Add OpenSSL as alternative SSL library
2018-07-30 14:13:05 +02:00
Lennart Poettering faf739a73d
Merge pull request #9747 from yuwata/workaround-structured-initialization
sd-resolve: use structured initialization and a workaround for nested structs
2018-07-30 13:25:37 +02:00
Yu Watanabe b127bc99d1 sd-resolve: workaround for structured initialization to nested structs
When a nested struct is initialized by structured initializer, then
padding space is not cleared by zero. So, before setting values,
this makes explicitly set zero including padding.

This fixes the following false positive warning by valgrind:
```
==492== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==492==    at 0x56D0CF7: sendmsg (in /usr/lib64/libpthread-2.27.so)
==492==    by 0x4FDD3C5: sd_resolve_getaddrinfo (sd-resolve.c:975)
==492==    by 0x110B9E: manager_connect (timesyncd-manager.c:879)
==492==    by 0x10B729: main (timesyncd.c:165)
==492==  Address 0x1fff0008f1 is on thread 1's stack
==492==  in frame #1, created by sd_resolve_getaddrinfo (sd-resolve.c:928)
==492==
```
2018-07-29 16:05:23 +09:00
Yu Watanabe 2a12960bcd sd-resolve: use structured initialization at more places 2018-07-29 16:01:37 +09:00
Yu Watanabe 8631708741 resolve: add option to toggle reading /etc/hosts
Workaround for #9718.
2018-07-28 21:46:00 +09:00
Yu Watanabe 452ca09152 resolve: make manager_etc_hosts_read() static 2018-07-28 20:36:13 +09:00
Iwan Timmer 04c4d9199e resolved: TCP Fast Open and TLS Session Tickets for OpenSSL
To decreae latency this add support for TFO and TLS Session Tickets. As OpenSSL wouldn't let you easily set a different function all written data is temporarily cached and therefore needs to be flushed after each SSL function which can write data.
2018-07-27 21:23:17 +01:00
Iwan Timmer 096cbdce13 resolved: basic OpenSSL support for DNS-over-TLS
This provides basic OpenSSL support without optimizations like TCP Fast Open and TLS Session Tickets.
Notice only a single SSL library can be enabled at a time and therefore journald functions provided by GnuTLS will be disabled when using OpenSSL.
Fixes #9531
2018-07-27 21:23:17 +01:00
Iwan Timmer ba6aaf5727 resolved: set io events after receiving EAGAIN for TLS
During handshake and TLS session closing, messages needs to be exchanged. Therefore this patch overrides the requested IO events for the TCP stream when the TLS is waiting for sending or receiving of messages during theses periods. This fixes issues with correctly closing the TLS stream and prevents the handshake from hanging in rare cases (not seen yet).
2018-07-27 21:23:17 +01:00
Iwan Timmer 6016fcb0ea resolved: refactor GnuTLS specific code in separate source file
This is a first step towards supporting alternative TLS implementations for DNS-over-TLS.

Co-authored-by: Filipe Brandenburger <filbranden@google.com>
2018-07-27 21:23:17 +01:00
Daniel 1595b257df void call of page_size guarantees that sysconf is not called from signal handler 2018-07-26 15:39:12 +02:00
Daniel 14a6aee050 changed exit(4) to asynchronous-safe _exit(4) in signal handler sig_alrm 2018-07-26 14:47:38 +02:00
Zbigniew Jędrzejewski-Szmek 4ee35e4e53
Merge pull request #9721 from yuwata/fix-resolve-memleak
Fix resolve memleak
2018-07-26 14:22:15 +02:00
Lennart Poettering c9177eb8ec
Merge pull request #9719 from poettering/sleep-fixes
require the kernel image to still exist before allowing hibernation
2018-07-26 14:03:18 +02:00
Zbigniew Jędrzejewski-Szmek 7426028b7a
Merge pull request #9720 from yuwata/fix-9702
Fix DynamicUser=yes with static User= whose UID and GID are different
2018-07-26 11:42:00 +02:00
Lennart Poettering 904865b8c2 sleep-config: library code should not log beyond LOG_DEBUG 2018-07-26 11:01:29 +02:00
Lennart Poettering edda44605f sleep: offer hibernation only if the kernel image still exists
This makes hibernation unavailable if the kernel image we are currently
running was removed. This is supposed to be superficial protection
against hibernating a system we can never return from because the kernel
has been updated and the kernel we currently run is not available
anymore.

We look at a couple of places for the kernel, which should cover all
distributions I know off. Should I have missed a path I am sure people
will quickly notice and we can add more places to check. (or maybe
convince those distros to stick their kernels at a standard place)
2018-07-26 11:01:29 +02:00
Lennart Poettering 7474f15b2d sleep-config: eat up errors only after debug logging about them 2018-07-26 11:01:29 +02:00
Lennart Poettering 3dea6886c2 sleep-config: partitions can't be deleted, only files can
This fixes something I think was basically a typo introduced in
db69869f26.
2018-07-26 11:01:29 +02:00
Yu Watanabe 52588e0bda resolve: use structured initialization and use new() instead of new0() 2018-07-26 17:45:34 +09:00
Yu Watanabe c0df8f834a resolve: fix memleak 2018-07-26 17:45:34 +09:00
Zbigniew Jędrzejewski-Szmek 82296b3e07
Merge pull request #9684 from yuwata/fix-9672
timedate, locale: fix barrier to suppress multiple function calls
2018-07-26 10:42:50 +02:00
Andrew Jorgensen 411ae92b40 shared/sleep-config: exclude zram devices from hibernation candidates
On a host with sufficiently large zram but with no actual swap, logind will
respond to CanHibernate() with yes. With this patch, it will correctly respond
no, unless there are other swap devices to consider.
2018-07-26 10:19:04 +02:00
Zbigniew Jędrzejewski-Szmek 54fe2ce1b9
Merge pull request #9504 from poettering/nss-deadlock
some nss deadlock love
2018-07-26 10:16:25 +02:00