summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-06-08Merge pull request #3431 from poettering/network-fixesTom Gundersen
put limits on addresses and routers per link and per network
2016-06-08Merge pull request #3470 from fbuihuu/logind-fix-ignore-inhibitLennart Poettering
Logind: fix handling of *KeyIgnoreInhibited options in logind.conf
2016-06-08logind: minor cleanup and use IN_SET() in manager_handle_action()Franck Bui
2016-06-08logind: really handle *KeyIgnoreInhibited options in logind.confFranck Bui
2016-06-08units: enable MemoryDenyWriteExecute (#3459)Topi Miettinen
Secure daemons shipped by systemd by enabling MemoryDenyWriteExecute. Closes: #3459
2016-06-08sysv-generator: remove more dead code (#3462)Lennart Poettering
The changes in 788d2b088b13a2444b9eb2ea82c0cc57d9f0980f weren't complete, only half the code that dealt with K links was removed. This is a follow-up patch that removes the rest too. No functional changes.
2016-06-07hwdb: selinuxify a bit (#3460)Evgeny Vereshchagin
-bash-4.3# rm /etc/udev/hwdb.bin -bash-4.3# systemd-hwdb update -bash-4.3# ls -Z /etc/udev/hwdb.bin system_u:object_r:systemd_hwdb_etc_t:s0 /etc/udev/hwdb.bin Fixes: #3458
2016-06-07networkd: rename IPv6AcceptRouterAdvertisements to IPv6AcceptRALennart Poettering
The long name is just too hard to type. We generally should avoid using acronyms too liberally, if they aren't established enough, but it appears that "RA" is known well enough. Internally we call the option "ipv6_accept_ra" anyway, and the kernel also exposes it under this name. Hence, let's rename the IPv6AcceptRouterAdvertisements= setting and the [IPv6AcceptRouterAdvertisements] section to IPv6AcceptRA= and [IPv6AcceptRA]. The old setting IPv6AcceptRouterAdvertisements= is kept for compatibility with older configuration. (However the section [IPv6AcceptRouterAdvertisements] is not, as it was never available in a published version of systemd.
2016-06-07Merge pull request #3394 from poettering/triple-tstampLennart Poettering
timestamping improvements and IPv6 RA revamp
2016-06-07sd-netlink: fix deep recursion in message destruction (#3455)David Herrmann
On larger systems we might very well see messages with thousands of parts. When we free them, we must avoid recursing into each part, otherwise we very likely get stack overflows. Fix sd_netlink_message_unref() to use an iterative approach rather than recursion (also avoid tail-recursion in case it is not optimized by the compiler).
2016-06-07fstab-generator: don't process root= if it happens to be "gpt-auto" (#3452)Lennart Poettering
As that's handled by "gpt-auto-generator". Fixes: #3404
2016-06-06os-release: Add VERSION_CODENAME field (#3445)Benjamin Drung
Debian and their derivatives (Ubuntu, Trisquel, etc.) use a code name for their repositories. Thus record the code name in os-release for processing. Closes systemd/systemd#3429
2016-06-06cgtop: minimize aux variable scopeLennart Poettering
2016-06-06core: add minor commentLennart Poettering
Let's explain #3444 briefly in the sources, too.
2016-06-06mount: make sure got into MOUNT_DEAD state after a successful umount (#3444)michaelolbrich
Without this code the following can happen: 1. Open a file to keep a mount busy 2. Try to stop the corresponding mount unit with systemctl -> umount fails and the failure is remembered in mount->result 3. Close the file and umount the filesystem manually -> mount_dispatch_io() calls "mount_enter_dead(mount, MOUNT_SUCCESS)" -> Old error in mount->result is reused and the mount unit enters a failed state Clear the old error result when 'mountinfo' reports a successful umount to fix this.
2016-06-06network: beef up ipv6 RA support considerablyLennart Poettering
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more comprehensively. Since the API is extended quite a bit networkd has been ported over too, and the patch is not as straight-forward as one could wish. The rework includes: - Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two new configuration options have been added to networkd to make this configurable. - sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA message, and has direct, friendly acessor functions for the singleton RA properties, as well as an iterative interface to iterate through known and unsupported options. The router object may either be retrieved from the wire, or generated from raw data. In many ways the sd-ndisc API now matches the sd-lldp API, except that no implicit database of seen data is kept. (Note that sd-ndisc actually had a half-written, but unused implementaiton of such a store, which is removed now.) - sd-ndisc will now collect the reception timestamps of RA, which is useful to make sd_ndisc_router fully descriptive of what it covers. Fixes: #1079
2016-06-06network: use inet_ntop() rather than SD_NDISC_ADDRESS_FORMAT_VAL() when ↵Lennart Poettering
serializing Let's use the usual libc API for serializing IPv6 addresses, instead of the NDISC-specific macro we should get rid of anyway.
2016-06-06util: make it easier to check whether in_addr or in6_addr addresses are NULLLennart Poettering
2016-06-06util-lib: add accessors for unaligned native endian wordsLennart Poettering
2016-06-06exit-status: update comments a bitLennart Poettering
2016-06-06lldp: include sys/types.h in sd-lldp.hLennart Poettering
After all, we use clockid_t which is defined there.
2016-06-06lldp: minor coding style improvementLennart Poettering
2016-06-06lldp: add sd_lldp_get_event() callLennart Poettering
sd-ndisc has something like this, let's add this for sd-lldp, too.
2016-06-06lldp: deal properly with recv() returning EAGAIN/EINTRLennart Poettering
It might very well return EAGAIN in case of packet checksum problems and suchlike, hence let's better handle this nicely, the same way as we do it in the other sd-network libraries for incoming datagrams.
2016-06-06lldp: pass correct neighbor object to REMOVED callbackLennart Poettering
2016-06-06lldp: rename TLV accessor pseudo-macrosLennart Poettering
Let's make sure the inline functions for retrieving TLV data actually carry TLV in the name, so that we don#t assume they retrieve the whole, raw packet data.
2016-06-06lldp: make sd_lldp_neighbor_tlv_rewind() return whether there's a first entryLennart Poettering
This way it's nicer to use as it matches how sd_lldp_neighbor_tlv_next() indicates an EOF too via its return value.
2016-06-06lldp: use NULL instead 0, when we deal with a pointerLennart Poettering
2016-06-06lldp: add _public_ to a two exported functions missing itLennart Poettering
2016-06-06lldp: clarify that sd_lldp_neighbor_get_ttl() returns secondsLennart Poettering
Let's simply encode this in the parameter name.
2016-06-06lldp: add proper ref counting to sd_lldp object and a separate call for ↵Lennart Poettering
setting the ifindex Let's make sd-lldp a bit more like sd-ndisc ant the other APIs, and add proper ref counting and a separate call for setting the ifindex. This also adds a new lldp_reset() call we can use at various places to close all fds. This is also similar to how sd-ndisc already does it.
2016-06-06exit-code: minor coding style updatesLennart Poettering
2016-06-06sd-lldp: take triple timestamp when reading LLDP packetsLennart Poettering
It's a good idea to store away the recption time of LLDP packets in the neighbor object, simply because the LLDP data only has a validity of a certain amount of time. Hence, let's record the timestamp when we receive the datagram and expose an API for it. Also, automatically expire LLDP neighbors based on this new timestamp.
2016-06-06sd-event: port over to new triple timestamp logicLennart Poettering
2016-06-06time-util: add triple timestamp objectLennart Poettering
We already have a double timestamp object that we use whenever we need both a MONOTONIC and a REALTIME timestamp taken and stored. With this change we also add a triple timestamp object that in addition stores a BOOTTIME timestamp, which is useful for a few usecases. Note that we keep dual_timestamp around, as it is useful in many cases where triple_timestamp is not, in particular because retrieving the monotonic and realtime timestamps is much cheaper on Linux that getting the boottime timestamp.
2016-06-06resolved: also rewrite private /etc/resolv.conf when configuration is ↵Lennart Poettering
changed via bus calls This also moves log message generation into manager_write_resolv_conf(), so that it is shorter to invoke the function, given that we have to invoke it at a couple of additional places now. Fixes: #3225
2016-06-06resolved: support IPv6 DNS servers on the local linkLennart Poettering
Make sure we can parse DNS server addresses that use the "zone id" syntax for local link addresses, i.e. "fe80::c256:27ff:febb:12f%wlp3s0", when reading /etc/resolv.conf. Also make sure we spit this out correctly again when writing /etc/resolv.conf and via the bus. Fixes: #3359
2016-06-06Two CODING_STYLE additionsLennart Poettering
2016-06-06machinectl: Added stop as alias for poweroff (#3406)Christian Rebischke
2016-06-06keymap-util: also "convert" 'ru' to 'ru'Zbigniew Jędrzejewski-Szmek
As discovered by Adam Williamson in https://bugzilla.redhat.com/show_bug.cgi?id=1333998#c32, after the changes in 81fd105a5f9 we would only match compound layouts, i.e. a comma would be required after 'ru' to match. This seems wrong, and we should match single layouts like too. So 'ru', 'ru,us' now both match. startswith_comma is changed to not require a comma, i.e. check that the prefix matches until a comma or the end of the string. Note that startswith_comma is called twice. At the first site, we check that strings are not equal beforehand, so this change to startswith_comma has no effect. At the second site, it does have an effect, as described above.
2016-06-06localed: also report when we couldn't convert X11→consoleZbigniew Jędrzejewski-Szmek
Rework the code a bit where find_converted_keymap cannot (and should not) be called with a null layout, so streq can be used instead of streq_ptr, etc. Note that the behaviour of vconsole_convert_to_x11 and x11_convert_to_vconsole is not symmetrical. When the latter cannot find a match, it simply makes the vconsole mapping empty. But vconsole_convert_to_x11 leaves the x11 layout unchanged. I don't know what the proper solution is here, so I'm just adding more verbose logging without changing the logic.
2016-06-06localed: be more verbose when keymap conversion to X11 failsZbigniew Jędrzejewski-Szmek
I was puzzled why "localectl set-keymap pl" does not change the X11 keymap. Output a message at notice level, becuase not converting the X11 keymap is most likely an error. We usually do not output non-debug messages from "library" code, but this isn't really library code, it's split out to a separate file only to allow it to be called from tests. (pl is not converted because we only have a mapping for pl2. This is intentional, even though we might want to change this. In any case, the conversion code works correctly.)
2016-06-06keymap-util: add tests and fix one small bugZbigniew Jędrzejewski-Szmek
When converting an empty x11 variant, we would not delete vconsole mapping properly. find_legacy_keymap() is made non-static. I think it's important to be able to test it. In principle we could also test it through the higher-level interface of x11_convert_to_vconsole, but x11_convert_to_vconsole also uses find_converted_keymap, and it's better to test at this lower level. Note that find_legacy_keymap might be a bit of a misnomer, because we'd probably want to keep kbd-model-map even if the "legacy" layouts went away. So we might want to change this name, but I'm leaving that for another commit.
2016-06-06localed: split out keymap parsing to a separate fileZbigniew Jędrzejewski-Szmek
This way the dbus and management logic is seperated from the business logic and we can write test cases for the mapping functionality.
2016-06-06localed: get rid of duplicated enum and string tableZbigniew Jędrzejewski-Szmek
2016-06-06networkd: remove unused variable (#3447)Tobias Jungel
this patch solves the following waring: ../src/network/networkd-ndisc.c:197:13: warning: unused variable ‘r’ [-Wunused-variable] int r; fixes acac5b2f
2016-06-06cgtop: fix ret pointer usage (#3443)Alessandro Puccetti
2016-06-05cgtop: add option to show a single cgroup subtree (#3413)Alessandro Puccetti
When many services are running, it was difficult to see only the interesting ones. This patch allows to show only the subtree of interest.
2016-06-05automount: handle expire_tokens when the mount unit changes its state (#3434)michaelolbrich
This basically reverts 7b2fd9d51259f6cf350791434e640ac3519acc6c ("core: remove duplicate code in automount_update_mount()"). This was not duplicate code. The expire_tokens need to be handled as well: Send 0 == success for MOUNT_DEAD (umount successful), do nothing for MOUNT_UNMOUNTING (not yet done) and an error for everything else. Otherwise the automount logic will assume unmounting is not done and will not send any new requests for mounting. As a result, the corresponding mount unit is never mounted. Without this, automounts with TimeoutIdleSec= are broken. Once the idle timeout triggered a umount, any access to the corresponding filesystem hangs forever. Fixes #3332.
2016-06-04systemctl: install sigbus handler (#3435)Evgeny Vereshchagin
This makes systemctl robust regarding journal truncation. This is a follow-up for 2cf4172a71860c6e44 Fixes: Core was generated by `./systemctl status systemd-journald'. Program terminated with signal SIGBUS, Bus error. PID 8569 - core TID 8569: #0 0x00007f246cc89ed6 __memcmp_sse4_1 #1 0x0000557ebbc6f42c journal_file_init_header #2 0x0000557ebbc77262 journal_file_open #3 0x0000557ebbc42999 file_type_wanted #4 0x0000557ebbc42e08 add_any_file #5 0x0000557ebbc43832 add_directory #6 0x0000557ebbc4401c add_root_directory #7 0x0000557ebbc442e9 add_root_directory #8 0x0000557ebbc446fc add_search_paths #9 0x0000557ebbbacb5e show_journal_by_unit #10 0x0000557ebbb8376d print_status_info #11 0x0000557ebbb86a0b show_one #12 0x0000557ebbb87954 show #13 0x0000557ebbc20b1f dispatch_verb #14 0x0000557ebbb90615 systemctl_main #15 0x0000557ebbb9159f main #16 0x00007f246cb3e731 __libc_start_main #17 0x0000557ebbb75ae9 _start