summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-11-26Merge pull request #1994 from karelzak/rlimitsLennart Poettering
core: support <soft:hard> ranges for RLIMIT options
2015-11-26Merge pull request #2034 from teg/resolved-fixDaniel Mack
minor resolved fixes
2015-11-26resolved: bus - follow CNAME chains when resolving addressesTom Gundersen
It may be unexpected to find a CNAME record when doing a reverse lookup, as we expect to find a PTR record directly. However, it is explicitly supported according to <https://tools.ietf.org/html/rfc2181#section-10.2>, and there seems to be no benefit to not supporting it.
2015-11-26resolved: do not reject NSEC records with empty bitmapsTom Gundersen
The assumption that no NSEC bitmap could be empty due to the presence of the bit representing the record itself turns out to be flawed. See (the admittedly experimental) RFC4956 for a counter example.
2015-11-25dns-domain: rework dns_label_escape() to not imply memory allocationLennart Poettering
The new dns_label_escape() call now operates on a buffer passed in, similar to dns_label_unescape(). This should make decoding a bit faster, and nicer.
2015-11-25dns-domain: change dns_srv_type_is_valid() return value to boolLennart Poettering
For similar reasons as dns_name_is_root() got changed in the previous commit.
2015-11-25dns-domain: simplify dns_name_is_root() and dns_name_is_single_label()Lennart Poettering
Let's change the return value to bool. If we encounter an error while parsing, return "false" instead of the actual parsing error, after all the specified hostname does not qualify for what the function is supposed to test. Dealing with the additional error codes was always cumbersome, and easily misused, like for example in the DHCP code. Let's also rename the functions from dns_name_root() to dns_name_is_root(), to indicate that this function checks something and returns a bool. Similar for dns_name_is_signal_label().
2015-11-25resolved: fully support DNS search domainsLennart Poettering
This adds support for searching single-label hostnames in a set of configured search domains. A new object DnsQueryCandidate is added that links queries to scopes. It keeps track of the search domain last used for a query on a specific link. Whenever a host name was unsuccessfuly resolved on a scope all its transactions are flushed out and replaced by a new set, with the next search domain appended. This also adds a new flag SD_RESOLVED_NO_SEARCH to disable search domain behaviour. The "systemd-resolve-host" tool is updated to make this configurable via --search=. Fixes #1697
2015-11-25resolved: expose some properties on the busLennart Poettering
For now, let's just expose the LLMNR hostname currently in use; a combined list of all dns servers with their interface indexes; a combined list of all search domains with their interface indexes.
2015-11-25resolved: split out calls to compile full list of dns servers and search domainsLennart Poettering
Let's split this out from the resolv.conf parser, so that this becomes generically useful.
2015-11-25util-lib: add ordered_set_ensure_allocated()Lennart Poettering
ordered_set_ensure_allocated() does for an OrderedSet, what set_ensure_allicated() does for a Set.
2015-11-25resolved: enforce a maximum limit on both dns servers and search domainsLennart Poettering
2015-11-25resolved: unify DnsServer handling code between Link and ManagerLennart Poettering
This copies concepts we introduced for the DnsSearchDomain stuff, and reworks the operations on lists of dns servers to be reusable and generic for use both with the Link and the Manager object.
2015-11-25resolved: add a generic DnsSearchDomain conceptLennart Poettering
With this change, we add a new object to resolved, "DnsSearchDomain=" which wraps a search domain. This is then used to introduce a global search domain list, in addition to the existing per-link search domain list which is reword to make use of this new object too. This is preparation for implement proper unicast DNS search domain support.
2015-11-25resolved: make sure order of dns servers is stableLennart Poettering
Previously, we'd keep adding new dns servers we discover to the end of our linked list of servers. When we encountered a pre-existing server, we'd just leave it where it was. In essence that meant that old servers ended up at the front, and new servers at the end, but not in an order that would reflect the configuration. With this change we ensure that every pre-existing server we want to add again we move to the back of the linked list, so that the order is stable and in sync with the requested configuration.
2015-11-25resolved: drop unused enum typeLennart Poettering
2015-11-25resolved: make sure FallbackDNS= overrides built-in servers, doesn't extend themLennart Poettering
Closes #342.
2015-11-25resolved: rework dns server lifecycle logicLennart Poettering
Previously, there was a chance of memory corruption, because when switching to the next DNS server we didn't care whether they linked list of DNS servers was still valid. Clean up lifecycle of the dns server logic: - When a DnsServer object is still in the linked list of DnsServers for a link or the manager, indicate so with a "linked" boolean field, and never follow the linked list if that boolean is not set. - When picking a DnsServer to use for a link ot manager, always explicitly take a reference. This also rearranges some logic, to make the tracking of dns servers by link and globally more alike.
2015-11-25resolved: move dns server picking code from resolved-manager.c to ↵Lennart Poettering
resolved-dns-server.c
2015-11-25resolved: indent less, by exiting earlierLennart Poettering
2015-11-25resolved: split out all code dealing with /etc/resolv.conf into its own .c fileLennart Poettering
No functional changes.
2015-11-25resolved: unify code for parsing dns server informationLennart Poettering
Let's use the same parser when parsing dns server information from /etc/resolv.conf and our native configuration file. Also, move all code that manages lists of dns servers to a single place. resolved-dns-server.c
2015-11-25resolved: /etc/resolved.conf missing is not an errorLennart Poettering
Don't propagate any error in this case, it's really not an error.
2015-11-25dns-domain: remove prototype for function that doesn't existLennart Poettering
2015-11-25resolved: don't claim DnsQuestion have to have the same namesLennart Poettering
Wen DnsQuestion objects are used for DnsQuery objects all contained keys have to share the same name, but otherwise they generally don't have to, and this can actually happen in real-life because DnsPacket objects for mDNS use DnsQuestion for the question section. Hence, rename: dns_question_is_valid() to dns_question_is_valid_for_query(), since the name uniqueness check it does is only relevant when used for a query. Similar, rename dns_question_name() to dns_question_first_name(), to be more accurate, as this difference matters if we keys don#t have to share the same name.
2015-11-25fstab-gen: post can't be NULLFranck Bui
2015-11-25networkd: link - do not drop config for loopback deviceChristian Hesse
Commit 5e5b137a (networkd: link - drop foreign config when configuring link) introduced a regression where addresses (including 127.0.0.1) are removed from loopback device. Do not handle loopback device when removing foreign configs. Signed-off-by: Christian Hesse <mail@eworm.de>
2015-11-25sd-dhcp: parse error message in DECLINE or NAKTom Gundersen
If a client sends a DECLINE or a server sends a NAK, they can include a string with a message to explain the error. Parse this and print it at debug level.
2015-11-25sd-ndisc: better validate RA packetsTom Gundersen
Verify the hoplimit and that the received packet is large enough for the RA header. See <http://tools.ietf.org/html/rfc4861#section-6.1.2>.
2015-11-25sd-ndisc: always send the link-layer addressTom Gundersen
We never send packets without first knowing the link-local L3 address, so we should always include the L2 address in RS packets.
2015-11-25libsystemd-network: clean up recv functionsTom Gundersen
2015-11-25core: support <soft:hard> ranges for RLIMIT optionsKarel Zak
The new parser supports: <value> - specify both limits to the same value <soft:hard> - specify both limits the size or time specific suffixes are supported, for example LimitRTTIME=1sec LimitAS=4G:16G The patch introduces parse_rlimit_range() and rlim type (size, sec, usec, etc.) specific parsers. No code is duplicated now. The patch also sync docs for DefaultLimitXXX= and LimitXXX=. References: https://github.com/systemd/systemd/issues/1769
2015-11-24resolved: remove unused variableThomas Hindoe Paaboel Andersen
2015-11-24Merge pull request #1976 from ssahani/word3Lennart Poettering
core: mount flags remove FOREACH_WORD_SEPARATOR
2015-11-24core: Do not bind a mount unit to a device, if it was from mountinfoHarald Hoyer
If a mount unit is bound to a device, systemd tries to umount the mount point, if it thinks the device has gone away. Due to the uevent queue and inotify of /proc/self/mountinfo being two different sources, systemd can never get the ordering reliably correct. It can happen, that in the uevent queue ADD,REMOVE,ADD is queued and an inotify of mountinfo (or libmount event) happend with the device in question. systemd cannot know, at which point of time the mount happend in the ADD,REMOVE,ADD sequence. The real ordering might have been ADD,REMOVE,ADD,mount and systemd might think ADD,mount,REMOVE,ADD and would umount the mountpoint. A test script which triggered this behaviour is: rm -f test-efi-disk.img dd if=/dev/null of=test-efi-disk.img bs=1M seek=512 count=1 parted --script test-efi-disk.img \ "mklabel gpt" \ "mkpart ESP fat32 1MiB 511MiB" \ "set 1 boot on" LOOP=$(losetup --show -f -P test-efi-disk.img) udevadm settle mkfs.vfat -F32 ${LOOP}p1 mkdir -p mnt mount ${LOOP}p1 mnt ... <dostuffwith mnt> Without the "udevadm settle" systemd unmounted mnt while the script was operating on mnt. Of course the question is, why there was a REMOVE in the first place, but this is not part of this patch.
2015-11-24basic: fix build on architectures with small longHelmut Grohne
The x32 architecture has a small "long" type which is not enough to hold struct statfs.f_type.
2015-11-24core: mount flags remove FOREACH_WORD_SEPARATORSusant Sahani
FOREACH_WORD_SEPARATOR is no need here since we only apply only one mount flag. The rvalue is sufficient for this.
2015-11-24resolved: implement client-side DNAME resolutionLennart Poettering
Most servers apparently always implicitly convert DNAME to CNAME, but some servers don't, hence implement this properly, as this is required by edns0.
2015-11-24question: drop dns_question_is_superset() which we don't use anymoreLennart Poettering
2015-11-23Merge pull request #1984 from phomes/networkd-routes-parseTom Gundersen
networkd: link - fix reading routes
2015-11-23resolved: add ResolveService() bus call for resolving SRV and DNS-SD servicesLennart Poettering
This also adds client-side support for this to systemd-resolve-host. Note that the ResolveService() API can deal both with DNS-SD service (consisting of service name, type and domain), as well as classic SRV services (consisting just of a type and a domain), all exposed in the same call. This patch also reworks CNAME handling in order to reuse it between hostname, RR and service lookups. In contrast to Avahi and Bonjour, this new API will actually reolve the A/AAAA RRs the SRV RRs point to in one go (unless this is explicitly disabled). This normally comes for free, as these RRs are sent along the SRV responses anyway, hence let's make use of that. This makes the API considerably easier to use, as a single ResolveService() invocation will return all necessary data to pick a server and connect() to it. Note that this only implements the DNS-SD resolving step, it does not implement DNS-SD browsing, as that makes sense primarily on mDNS, due to its continuous nature.
2015-11-23resolved: fix minor memory leak when shuttin downLennart Poettering
We need to free the rtnl watch too.
2015-11-23dns-domain: add calls to join/split SRV/DNS-SD service domainsLennart Poettering
This adds dns_service_join() and dns_service_split() which may be used to concatenate a DNS-SD service name, am SRV service type string, and a domain name into a full resolvable DNS domain name string. If the service name is specified as NULL, only the type and domain are appended, to implement classic, non-DNS-SD SRV lookups. The reverse is dns_service_split() which takes the full name, and split it into the three components again.
2015-11-23escape: add cescape_length() call as generalization of cescape()Lennart Poettering
2015-11-23resolved: accept TXT records with non-UTF8 stringsLennart Poettering
RFC 6763 is very clear that TXT RRs should allow arbitrary binary content, hence let's actually accept that. This also means accepting NUL bytes in the middle of strings.
2015-11-23dns-domain: add code for verifying validity of DNS-SD service names and typesLennart Poettering
2015-11-23Merge pull request #2003 from eworm-de/virtLennart Poettering
virt: add comment about order in virtualization detection
2015-11-23nss-mymachines: do not allow overlong machine namesZbigniew Jędrzejewski-Szmek
https://github.com/systemd/systemd/issues/2002
2015-11-23virt: add comment about order in virtualization detectionChristian Hesse
2015-11-23Merge pull request #1997 from fbuihuu/fix-swap-unit-ordering-depLennart Poettering
make sure all swap units are ordered before the swap target