summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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
2015-11-23Merge pull request #1998 from eworm-de/virtLennart Poettering
virt: detect dmi before cpuid
2015-11-23Merge pull request #1986 from tjanez/fix-systemd_user_postZbigniew Jędrzejewski-Szmek
rpm: fix %systemd_user_post() macro.
2015-11-23Convert file trigger scripts to luaZbigniew Jędrzejewski-Szmek
At least the %filetriggerpostun script can be invoked hundreds of times during an upgrade, so it makes sense to optimize it a bit. assert(exec(...)) is used because of https://bugzilla.redhat.com/show_bug.cgi?id=1094072. Add -P (--priority) to have %filetriggerpostun run as early as possible (before any reload/stop actions), and %transfiletriggerin as late as possible (after any enable/disable/preset actions).
2015-11-23virt: detect dmi before cpuidChristian Hesse
Virtualbox should be detected as 'oracle'. This used to work but broke with commit: commit 75f86906c52735c98dc0aa7e24b773edb42ee814 Author: Lennart Poettering <lennart@poettering.net> Date: Mon Sep 7 13:42:47 2015 +0200 basic: rework virtualization detection API We swap detection for dmi and cpuid, this fixes Virtualbox with KVM. Hopefully it does not break anything else.
2015-11-23make sure all swap units are ordered before the swap targetFranck Bui
When shutting down the system, the swap devices can be disabled long time before the swap target is stopped. They're actually the first units systemd turns off on my system. This is incorrect and due to swap devices having multiple associated swap unit files. The main one is usually created by the fstab generator and is used to start the swap device. Once done, systemd creates some 'alias' units for the same swap device, one for each swap dev link. But those units are missing an ordering dependencies which was created by the fstab generator for the main swap unit. Therefore during shutdown those 'alias' units can be stopped at anytime before unmount.target target. This patch makes sure that all swap units are stopped after the swap.target target.
2015-11-23tests: add sd_event_now to test_basicEvgeny Vereshchagin
2015-11-22Rework file trigger scripts to fire at the right timeZbigniew Jędrzejewski-Szmek
This turns out to be more complicated than it looked initially... %transfiletriggerun is called early, while %transfiletriggerin is called late, and neither satifisfies the requirement to call daemon-reload after new unit files have been installed, but before %postun scripts in packages get to fire. It seems that the only solution is to use %filetriggerun (which is called once per package) to do the reload, and keep state in /var/lib/rpm-state/systemd/ to avoid calling the reload multiple times. https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Saving_state_between_scriptlets says that /var/lib/rpm-state/systemd/ is the right dir.
2015-11-22systemctl: do not return uninitialized rThomas Hindoe Paaboel Andersen
Regresssed during port to extract_first_word in 5ab22f3321d238957c03dcc6a6db76491e3989b8 CID #1338060
2015-11-22rpm: fix %systemd_user_post() macro.Tadej Janež
Escape "--user" and "--global" arguments with "\\" since rpm treats arguments starting with "-" as macro options which causes "Unknown option" rpm error. Use %{expand:...} to force expansion of the inner macro. Otherwise %{?*} is recursively defined as "\--user \--global {%?*}" which causes "Too many levels of recursion in macro expansion" rpm error. Thanks to Michael Mráka for helping me fix the above issues.
2015-11-22networkd: link - fix reading routesThomas Hindoe Paaboel Andersen
This regressed during the port to extract_first_word in c598ac76 (v228). CID #1338083
2015-11-22core: allow 'SetUnitProperties()' to run on inactive units tooFranck Bui
'set-property' has been primarly designed to change some properties of *active* units. However it can easily work on inactive units as well. In that case changes are only saved in a drop-in for futur uses and changes will be effective when unit will be started. Actually it already works on inactive units but that was not documented and not fully supported. Indeed the inactive units had to be known by the manager otherwise it was reported as not loaded: $ systemctl status my-test.service * my-test.service - My Testing Unit Loaded: loaded (/etc/systemd/system/my-test.service; static; vendor preset: disabled) Drop-In: /etc/systemd/system/my-test.service.d Active: inactive (dead) $ systemctl set-property my-test.service MemoryLimit=1000000 Failed to set unit properties on my-test.service: Unit my-test.service is not loaded. [ Note: that the unit load state reported by the 'status' command might be confusing since it claimed the unit as loaded but 'set-property' reported the contrary. ] One can possibily workaround this by making the unit a dependency of another active unit so the manager will keep it around: $ systemctl add-wants multi-user.target my-test.service Created symlink from /etc/systemd/system/multi-user.target.wants/my-test.service to /etc/systemd/system/my-test.service. $ systemctl set-property my-test.service MemoryLimit=1000000 $ systemctl status my-test.service * my-test.service - My Testing Unit Loaded: loaded (/etc/systemd/system/my-test.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/my-test.service.d `-50-MemoryLimit.conf Active: inactive (dead) This patch simply forces 'SetUnitProperties()' to load the unit if it's not already the case. It also documents the fact that 'set-property' can be used on inactive units.
2015-11-22Introduce bus_unit_check_load_state() helperFranck Bui
This function is used to check that a previous unit load succeed and returns 0 in this case. In the case the load failed, the function setup a bus error accordingly and returns -errno.
2015-11-22tests: add missing sd_event_add_post to test_basicEvgeny Vereshchagin
2015-11-22tests: check exit handler invocationEvgeny Vereshchagin
2015-11-22sd-event: use prioq_ensure_allocated where possibleEvgeny Vereshchagin
2015-11-19sd-event: define a new PREPARING stateLennart Poettering
We already have a state RUNNING and EXITING when we dispatch regular and exit callbacks. Let's introduce a new state called PREPARING that is active while we invoke preparation callbacks. This way we have a state each for all three kinds of event handlers. The states are currently not documented, hence let's add a new state to the end, before we start documenting this.
2015-11-19sd-event: make _ref() calls NOPs when NULL is passed to themLennart Poettering
Let's make _ref() calls happy when NULL is passed to them, and simply return NULL without any assertion logic. This makes them nicely symmetric to the _unref() calls which also are happy to take NULL and become NOPs then.
2015-11-19Merge pull request #1947 from phomes/sort-includes2Lennart Poettering
tree-wide: sort includes in *.h
2015-11-19Merge pull request #1958 from teg/networkd-fixesDaniel Mack
nd-ndisc: don't fail if src address is unset
2015-11-19nd-ndisc: don't fail if src address is unsetTom Gundersen
This happens when running our test-suite over a socketpair, so don't fall over in that case. Fixes issue #1952.
2015-11-19test: remove wrong endianess conversion in test-siphash24Martin Pitt
Commit 933f9caee changed the returned result of siphash24_finalize() from little-endian to native. Follow suit in test-siphash24 and drop the endianess conversion there as well, so that this succeeds on big-endian machines again. Fixes #1946.
2015-11-19Merge pull request #1931 from bengal/dhcp-fqdn-v2Tom Gundersen
libsystemd-network: add support for "Client FQDN" DHCP option (v2)
2015-11-19Merge pull request #1944 from poettering/randoms-ecTom Gundersen
add RandomSec= setting to timer units, and more
2015-11-19Revert "networkd: ndisc - revert to letting the kernel handle NDisc"Tom Gundersen
This reverts commit 23f186494cf041107896fc4bd7fc5b8f921fd79f. The bug has now been fixed, so we can go back to managing this ourselves.