summaryrefslogtreecommitdiff
path: root/src/resolve
AgeCommit message (Collapse)Author
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-18resolved: allow DnsAnswer objects with no space for RRsLennart Poettering
They might be created as result of merged answer sets, hence accept them. http://lists.freedesktop.org/archives/systemd-devel/2015-April/030834.html
2015-05-18resolved: fix crash when shutting downLennart Poettering
Reported by Cristian Rodríguez http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
2015-05-18util: split all hostname related calls into hostname-util.cLennart Poettering
2015-04-29tree-wide: get rid of a few more explicit bus parametersLennart Poettering
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-04-11shared: add random-util.[ch]Ronny Chevalier
2015-04-08resolved: maintain order when writing resolv.conf entriesLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2015-March/029850.html
2015-03-27fix gcc warnings about uninitialized variablesHarald Hoyer
like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
2015-03-13Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek
We were using a space more often than not, and this way is codified in CODING_STYLE.
2015-03-13tree-wide: there is no ENOTSUP on linuxDavid Herrmann
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-03-03Do not advertise .d snippets over main config fileZbigniew Jędrzejewski-Szmek
For daemons which have a main configuration file, there's little reason for the administrator to use configuration snippets. They are useful for packagers which need to override settings, but we shouldn't advertise that as the main way of configuring those services. https://bugs.freedesktop.org/show_bug.cgi?id=89397
2015-02-23resolved: use == for comparing unsigned against zeroZbigniew Jędrzejewski-Szmek
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-12include <poll.h> instead of <sys/poll.h>Thomas Hindoe Paaboel Andersen
include-what-you-use automatically does this and it makes finding unnecessary harder to spot. The only content of poll.h is a include of sys/poll.h so should be harmless.
2015-02-12Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"Lennart Poettering
This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656. It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw sockets.
2015-02-10tree-wide: Always use recvmsg with MSG_CMSG_CLOEXECCristian Rodríguez
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
2015-01-26treewide: fix multiple typosTorstein Husebø
2015-01-23resolved: when rereading /etc/resolv.conf, always start using first DNS ↵Lennart Poettering
server again Previously we tried to stick to a DNS server as long as it is available. When /etc/resolv.conf changed, and the old DNS server we used was still in there we'd continue to use it, even if it was at the end of the list. With this change we'll now always start with the first DNS server in the list again. Rationale: certain network managing implementations (notably NetworkManager) when connected to a VPN place both the VPN DNS server as well as the local DNS server in /etc/resolv.conf. If we used the local one before we would thus continue to use the local one, making VPN names unresolvable. NetworkManager really should be fixed to only place the VPN DNS servers in the file, but with this commit things are at least similarly bad as they used to be...
2015-01-23#pragma once here and thereZbigniew Jędrzejewski-Szmek
2015-01-22tests: use assert_se instead of assertRonny Chevalier
Otherwise they can be optimized away with -DNDEBUG
2014-12-30tree-wide: spelling fixesVeres Lajos
https://github.com/vlajos/misspell_fixer https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa Thanks to Torstein Husebo <torstein@huseboe.net>.
2014-12-28tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering
2014-12-11networkd/resolved: correct spacing near eol in code commentsTorstein Husebø
2014-12-10sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering
src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
2014-12-03resolved: don't resolve the hostname "gateway" with LLMNR, leave that to ↵Lennart Poettering
nss-myhostname
2014-12-01resolved: make TXT RR generation and parsing more in-line with RFC 6763, ↵Lennart Poettering
section 6.1 The RFC says to encode an single empty TXT string instead of an empty TXT array. It also says to treat a zero-length TXT RR as a TXT array with a single zero-length string.
2014-11-30resolve: remove unused variableRonny Chevalier
2014-11-29resolved: Support resolved.conf.d directories in the usual search pathsJosh Triplett
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: a few more log_*_errno + return simplificationsMichal Schmidt
The one in tmpfiles.c:create_item() even looks like it fixes a bug.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-27resolve: reject empty TXT recordsStanisław Pitucha
TXT records should have at least one character, so enforce this. Before 0f84a72 parser SIGSEGV'd on ->txt.strings being NULL, but even if this is fixed we should reject invalid TXT records.
2014-11-27resolve: set error code on failureStanisław Pitucha
Set the error code in case of incorrect name. This prevents continuing and failing an assert(name) later on.
2014-11-27resolve: fix redirection loops in compressed RRStanisław Pitucha
Loops in RR compression were only detected for the first entry. Multiple redirections should be allowed, each one checking for an infinite loop on its own starting point. Also update the pointer on each redirection to avoid longer loops of labels and redirections, in names like: (start) [len=1] "A", [ptr to start] (David: rename variable to "jump_barrier" and add reference to RFC)
2014-11-27resolve: fix NULL deref on strv comparisonDavid Herrmann
A strv might be NULL if it is empty. The txt.strings comparison doesn't take that into account. Introduce strv_equal() to provide a proper helper for this and fix resolve to use it. Thanks to Stanisław Pitucha <viraptor@gmail.com> for reporting this!
2014-11-25resolved: fix typo in sd_notify() callTom Gundersen
2014-11-17resolve: fix CID#1237549 Unchecked return valueSusant Sahani
2014-11-01resolved: dns-packet - use unaligned read/write helpersTom Gundersen
2014-10-23resolve: make DnsScope::conflict_queue an OrderedHashmapMichal Schmidt
on_conflict_dispatch() uses hashmap_steal_first() and then does something non-trivial with it. It may care about the order.
2014-10-23mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho
2014-10-22resolved: simplify detection of packets from the loopback deviceLennart Poettering
We can simplify our code quite a bit if we explicitly check for the ifindex being 1 on Linux as a loopback check. Apparently, this is hardcoded on Linux on the kernel, and effectively exported to userspace via rtnl and such, hence we should be able to rely on it.
2014-10-17resolve: add missing headerLukasz Skalski
Change-Id: I64f7c6b446f6d92057c35cc3d4e29bd2bad8f75b
2014-10-13resolved: apply label to /run/systemd/resolve/resolv.confZbigniew Jędrzejewski-Szmek
Under an SELinux system, we want the file that is created to have a proper context, different from the default for files in /run. This is so that the policy can give access to almost everyone to this file.
2014-10-13resolved: split out writing of resolv.confZbigniew Jędrzejewski-Szmek
manager_write_resolv_conf() is quite long anyway.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-13resolved: fall back to hardcoded ifindex when checking if a link is the loopbackTom Gundersen
Reported by Philippe De Swert <philippedeswert@gmail.com>. Coverity CID#1237656