Commit graph

24631 commits

Author SHA1 Message Date
Lennart Poettering 1d35b2d6e2 Merge pull request #2424 from keszybz/journald-disk-usage
Journald disk usage
2016-01-26 14:20:45 +01:00
Lennart Poettering e167d7fd8d journald: minor fixes
This primarily contains some minor coding style fixups for 7a24f3bf2f and earlier changes. Specifically:

* Don't log at log levels above LOG_DEBUG from "library" code like journal-file.c

* Don't negate errno values before passing them to log_debug_errno(), as the call can handle this fine anyway

* Cast some calls we knowingly ignore the return values of to (void)

* Don't clobber function call-by-ref return values on failure

* Don't mix function calls and variable declarations in one line

There's also one more relevant change: when failing to enqueue a journal change fs event, we'll run it immediately.
2016-01-26 14:13:30 +01:00
Michal Sekletar 1359fffa57 shutdown: complain if process excluded from killing spree runs of the same rootfs as PID1 2016-01-26 14:13:13 +01:00
Daniel Mack d8fc78b40f Merge pull request #2436 from grawity/fix/tasks-max
logind: update documentation for cf7d1a30e4
2016-01-26 13:36:30 +01:00
Mantas Mikulėnas 5abea6149a logind: update documentation for cf7d1a30e4 2016-01-26 14:24:06 +02:00
Daniel Mack afb3e6335a Merge pull request #2434 from keszybz/man-pages
Man pages
2016-01-26 09:39:56 +01:00
Daniel Mack 709a7eb803 Merge pull request #2435 from evverx/tests-setup-selinux
tests: add setup_selinux
2016-01-26 09:12:38 +01:00
Zbigniew Jędrzejewski-Szmek 6a089ddddd man: add stub sd-bus(3)
We have 126 broken links to sd-bus.html, it's nice to fix that.
Current version is mostly a stub, with a long list of links to other
pages. I think that's fine, especially that sd-bus might evolve
quite a bit before it is made public.

Not all of linked pages are written. Still missing:
sd_bus_can_send
sd_bus_get_name_creds
sd_bus_get_owner_creds
sd_bus_message_can_send
sd_bus_message_get_creds
sd_bus_message_set_allow_interactive_authorization
sd_bus_send
sd_bus_set_address
sd_bus_set_description
sd_bus_start
sd_event_set_prepare
sd-device
systemd.busname
2016-01-25 20:20:58 -05:00
Zbigniew Jędrzejewski-Szmek a3972469b2 man: fix reference to sd_event_source_get_io_revents 2016-01-25 20:05:09 -05:00
Zbigniew Jędrzejewski-Szmek 524f3e5c9d man: fix references to a few external man pages
Noticed in pull request #2067.
2016-01-25 20:04:58 -05:00
Zbigniew Jędrzejewski-Szmek ce245c842b build-sys: provide fallback value for xsltproc
Commit ab6f56debf made the change to allow building man pages even when disabled
with ./configure --disable-manpages. This works fine, as long as xsltproc is
present. If xsltproc is not present, the command to build a man page (obviously)
fails. Unfortnately it fails with a cryptic message '-o not found', because
$(XSLTPROC) is empty. Add a fallback, to use 'xsltproc' is $(XSLTPROC) is not
defined. This way we get a nice message:

make: xsltproc: Command not found
2016-01-25 19:10:46 -05:00
Douglas Christman 655fd9d71f zsh-completion: Escape results for journalctl --unit
Escape colons and backslashes in unit names.
This gives correct completions for units with names like
    systemd-backlight@backlight:acpi_video0.service
and
    systemd-fsck@dev-disk-by\x2duuid-...
2016-01-25 18:10:31 -05:00
Tom Gundersen f49ce89edf Merge pull request #2392 from poettering/dnssec18
eightteenth dnssec patch
2016-01-25 20:28:38 +01:00
Lennart Poettering 164228707d Merge pull request #2240 from hgwalles/coredump-delete-bug
coredump: fix bug that loses core dump files when core dumps are compressed and disk space is low.
2016-01-25 19:34:52 +01:00
Hayden Walles 5f3e0a7468 coredump: fix bug that loses core dump files when core dumps are compressed and disk space is low.
Previously the save_external_coredump function returned a file
descriptor corresponding to the dumped file.  This descriptor was used
for two different purposes by calling code: a) access to the raw core
dump data; b) testing candidate files (via inode comparisons) while
vacuuming to protect the current core dump from vacuuming.

The descriptor returned always corresponded to a file containing the raw
core dump data.  However if compresson was used and the core dump was
compressed then the descriptor returned did not correspond to the file
that would eventually be left on disk (ie the compressed file).  Thus
the file was never protected by vacuuming.  When disk space was low all
core dumps including the current one would be vacuumed and the
corresponding log message referred to a file that no longer existed.

This resulted in the following error message from coredumpctl if the
missing core dump was requested:
   Cannot retrieve coredump from journal nor disk.
   Failed to retrieve core: No such file or directory

save_external_coredump now returns two descriptors, one to be used for
inode comparisons to prevent overzealous vacuuming and one to be used
for raw data access.  When compression is not used the returned inode
comparison descriptor will be invalid, indicating that the raw data
access descriptor should be used for inode comparisons as well.

Corresponding use of save_external_coredump and the returned
descriptors also updated.
2016-01-25 12:21:11 -05:00
Zbigniew Jędrzejewski-Szmek 7b213864af Merge pull request #2430 from lnykryn/is-active-failed
systemctl: is-active/failed should return 0 if at least one unit is in given state

Previously:
[lnykryn@notas lnykryn-systemd(is-active-failed)]$ systemctl is-failed fail cups; echo $?
failed
active
1

now:
[lnykryn@notas lnykryn-systemd(is-active-failed)]$ ./systemctl is-failed fail cups; echo $?
failed
active
0
2016-01-25 11:52:22 -05:00
Lennart Poettering 6c1e69f945 udev: filter out non-sensically high onboard indexes reported by the kernel
Let's not accept onboard interface indexes, that are so high that they are obviously non-sensical.

Fixes: #2407
2016-01-25 17:50:33 +01:00
Lennart Poettering 4cb94977ed resolved: don't consider NSEC/NSEC3 RRs as "pimary" for transactions
So far, abritrary NSEC and NSEC3 RRs were implicitly consider "primary" for any transaction, meaning we'd abort the
transaction immediately if we couldn't validate it. With this patch this logic is removed, and the NSEC/NSEC3 RRs will
not be considered primary anymore. This has the effect that they will be dropped from the message if they don't
validate, but processing continues. This is safe to do, as they are required anyway to validate positive wildcard and
negative responses, and if they are missing then, then message will be considered unsigned, which hence means the
outcome is effectively the same.

This is benefical in case the server sends us NSEC/NSEC3 RRs that are not directly related to the lookup we did, but
simply auxiliary information. Previously, if we couldn't authenticate those RRs we'd fail the entire lookup while with
this change we'll simply drop the auxiliary information and proceed without it.
2016-01-25 17:19:20 +01:00
Lennart Poettering cbd100ac7c resolved: don't insist in RRSIG metadata for NSEC3 RRs that have not been authenticated
In some cases we get NSEC3 RRs that have not been authenticated (because the chain of trust to the root is somewhere
broken). We can use these for checking negative replies, as long as we don't claim they were ultimately authenticated.
This means we need to be able to deal with NSEC3 RRs that lack RRSIG metadata.
2016-01-25 17:19:20 +01:00
Lennart Poettering ab88b6d087 resolved: use dns_query_reset_answer() where we can 2016-01-25 17:19:20 +01:00
Lennart Poettering b8b143c5ff update DNSSEC TODO 2016-01-25 17:19:20 +01:00
Lennart Poettering a7bf2ada62 resolved: properly propagate query candidate error
We already properly propagate errors from transactions to queries. Make sure that errors that happened during handling
of query candidates are propagated to the query, too.
2016-01-25 17:19:20 +01:00
Lennart Poettering 7cc6ed7ba6 resolved: replace DNS_TRANSACTION_RESOURCES by DNS_TRANSACTION_ERRNO
Whenever we encounter an OS error we did not expect, we so far put the transaction into DNS_TRANSACTION_RESOURCES
state. Rename this state to DNS_TRANSACTION_ERRNO, and save + propagate the actual system error to the caller. This
should make error messages triggered by system errors much more readable by the user.
2016-01-25 17:19:19 +01:00
Lennart Poettering f25f9e8d60 catalog: add DNSSEC log messages to message catalog 2016-01-25 17:19:19 +01:00
Lennart Poettering b35f360bbd catalog: fix line width to 79 chars
Line breaks default to 119 characters for systemd sources now, configured through the .vimrc and .dir-local.el files.
However, for the catalog files we really should stick to 79 chars, as they are regularly shown on terminal screens.
2016-01-25 17:19:19 +01:00
Lennart Poettering 1e02e182f1 resolved: log recognizably about DNSSEC downgrades
If we downgrade from DNSSEC to non-DNSSEC mode, let's log about this in a recognizable way (i.e. with a message ID),
after all, this is of major importance.
2016-01-25 17:19:19 +01:00
Lennart Poettering dd0bc0f141 resolved: synthesize RRs for data from /etc/hosts
This way the difference between lookups via NSS and our native bus API should become minimal.
2016-01-25 17:19:19 +01:00
Lennart Poettering 528e685ebd resolved: when synthesizing RR responses, own the name fully
When we synthesize A/AAAA for domains like "localhost", then make sure we generate ENODATA if the user asks for RR
types such a RP to be solved on the name. Previously, we'd pass the error back in that case that was generated from the
usual lookup procedure.
2016-01-25 17:19:19 +01:00
Lennart Poettering 0791110fbe resolved: properly handle LLMNR/TCP connection errors
The LLMNR spec suggests to do do reverse address lookups by doing direct LLMNR/TCP connections to the indicated
address, instead of doing any LLMNR multicast queries. When we do this and the peer doesn't actually implement LLMNR
this will result in a TCP connection error, which we need to handle. In contrast to most LLMNR lookups this will give
us a quick response on whether we can find a suitable name. Report this as new transaction state, since this should
mostly be treated like an NXDOMAIN rcode, except that it's not one.
2016-01-25 17:19:19 +01:00
Lennart Poettering 7bb70b6e3d core: normalize error handling a bit, in setup_pam()
Assign errno-style errors to a variable called "r" when they happen, the same way we do this in most other calls. It's
bad enough that the error handling part of the function deals with two different error variables (pam_code and r) now,
but before this fix it was even three!
2016-01-25 17:19:19 +01:00
Lennart Poettering 3347dd5ea1 resolved: fix rcode formatting string length
Since we honour the edns rcode extension we need more than 4 bits to format it. To avoid further confusion, derive the
right length from the type.
2016-01-25 17:19:19 +01:00
Lennart Poettering 3731ad2703 github: extend README.md a bit
Link up more stuff on the GitHub landing page.
2016-01-25 17:19:19 +01:00
Lennart Poettering cc5fddef6b github: add a CONTRIBUTING.md file that github shows when a PR or issue is filed
github links up CONTRIBUTING.md if it exists from the issue/PR filing form. Let's add one, in the hope that people have
a look before filing a PR.
2016-01-25 17:19:19 +01:00
Lennart Poettering 0aa5f6983f README: drop link to systemd-commits ML
Since we moved to github the commits ML is basically dead, hence don't advertise it anymore.
2016-01-25 17:19:19 +01:00
Lennart Poettering 1c4e4227fa CODING_STYLE: make sure line break recommendation matches edit configuration
In the .vimrc and .dir-locals.el we suggest a line width of 119. We should recommend the same in CODING_STYLE.
2016-01-25 17:19:19 +01:00
Lennart Poettering 7405bb3ec0 resolve: fix wording in resolver statistics output
Now that we count both negative and positive validation results, we shouldn't claim we just counted RRsets.
2016-01-25 17:19:19 +01:00
Lennart Poettering 59c5b5974d resolved: log each time we increase the DNSSEC verdict counters
Also, don't consider RRs that aren't primary to the lookups we do as relevant to the lookups.
2016-01-25 17:19:19 +01:00
Lennart Poettering f6618dcd96 resolved: never store NSEC/NSEC3 RRs from the upper zone of a zone cut in cache
When using NSEC/NSEC3 RRs from the cache to derive existance of arbitrary RRs, we should not get confused by the fact
that NSEC/NSEC3 RRs exist twice at zone cuts: once in the parent zone, and once in the child zone. For most RR types we
should only consult the latter since that's where the beef is. However, for DS lookups we have to check the former.

This change makes sure we never cache NSEC/NSEC3 RRs from any parent zone of a zone-cut. It also makes sure that when
we look for a DS RR in the cache we never consider any cached NSEC RR, as those are now always from the child zone.
2016-01-25 17:19:19 +01:00
Lennart Poettering fcfaff1235 resolved: if we detect a message with incomplete DNSSEC data, consider this an invalid packet event 2016-01-25 17:19:19 +01:00
Lennart Poettering 7aa8ce9855 resolved: also collect statistics about negative DNSSEC proofs
We already maintain statistics about positive DNSSEC proofs, and count them up by 1 for each validated RRset. Now,
update the same counters each time we validated a negative query, so that the statistics are the combined result of all
validation checks, both positive and negative.
2016-01-25 17:19:19 +01:00
Lennart Poettering 352af30838 resolve: use different bitmap checking rules when we find an exact NSEC3 match, or just a covering enclosure
If we are looking for a DS RR we need to check the NSEC3 bitmap of the parent zone's NSEC3 RR, not the one from the
child. For any other RR we need to look at the child's however, hence enforce this with the bitmaps.

Note that not coverign checks only the lower zone's NSEC3 bitmaps matter, hence the existing check is fine.
2016-01-25 17:19:18 +01:00
Lennart Poettering 300a716dc4 resolve: minor strings improvements 2016-01-25 17:19:18 +01:00
Lennart Poettering 624993ac85 man: document systemd-resolve(8)
This also links up the new manpage from systemd-resolved.service(8), and makes a couple of unrelated additions.
2016-01-25 17:19:18 +01:00
Zbigniew Jędrzejewski-Szmek 32917e3388 journald: restore oom safety
v2:
- use xsprintf
2016-01-25 10:53:51 -05:00
Lennart Poettering 54230826fd emacs: also configure nxml parameters in .dir-locals.el
We configure the parameters we use for the docbook XML.
2016-01-25 16:00:28 +01:00
Lennart Poettering b5eb973b39 resolve: rename "systemd-resolve-host" tool to simply "systemd-resolve"
The tool resolves way more than just hosts, hence give it a more generic name. This should be safe, as the tool is
currently undocumented. Before we add documentation for it, let's get the name right.

This also moves the C source into src/resolve/ (from src/resolve-host/), since the old name is a misnomer now. Also,
since it links directly to many of the C files of resolved it really belongs into resolved's directory anyway.
2016-01-25 16:00:28 +01:00
Lennart Poettering ce736ace37 resolved: get rid of unnecessary if check
DNS_ANSWER_FOREACH() can deal with NULL answers anyway, let's simplify our code here.
2016-01-25 15:59:40 +01:00
Lennart Poettering 839a4a20d8 resolved: split out RR synthesis logic into its own C file
Also, while we are at it, set the "authenticated" bit for everything we synthesize
2016-01-25 15:59:40 +01:00
Lennart Poettering d07b43a18e resolved: move dns_type_to_af() to dns-type.c 2016-01-25 15:59:40 +01:00
Lennart Poettering edbcc1fdd9 resolve: generate a nice clean error when clients try to resolve a name when the network is down 2016-01-25 15:59:40 +01:00