summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* core/dbus-unit: add property_get_requires_mounts_for() to send correct ↵Yu Watanabe2017-11-141-1/+32
| | | | | | | | | | message (#7322) PR #7186 changes requires_mounts_for from strv to Hashmap. So, it is necessary to implement a function for getting the property RequiresMountsFor=. This introduces property_get_requires_mounts_for() which reads the Hashmap and sends messages to bus. Fixes #7321.
* Fix error message when binding files (#7196)Zeal Jagannatha2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | If you use machinectl to bind a file into a container, it responds with a confusing error message about a temporary directory not being a directory. I just swapped it to error with the source that was passed, rather than the tmpdir. It would also be nice to be able to bind files, but that's a separate issue (#7195). Before the change: root@epona /var/lib/sandbox $ cat bar/foo Hello world! root@epona /var/lib/sandbox $ machinectl bind testing /var/lib/sandbox/bar/foo /foo Failed to bind mount: Failed to overmount /tmp/propagate.W5TNsj/mount: Not a directory After the change: root@epona /var/lib/sandbox $ machinectl bind testing /var/lib/sandbox/bar/foo /foo Failed to bind mount: Failed to overmount /var/lib/sandbox/bar/foo: Not a directory
* systemctl: print a friendly message when systemctl is invoked, but PID 1 is ↵Lennart Poettering2017-11-131-0/+6
| | | | | | | | not systemd (#7318) We only show this message when we can't talk to systemd, so that client side install can work. Fixes: https://bugzilla.freedesktop.org/show_bug.cgi?id=69962
* core: only warn about BPF/cgroup missing once per runtime (#7319)Lennart Poettering2017-11-132-6/+18
| | | | | | | | Let's reduce the amount of noise a bit, there's little point in complaining loudly about every single unit like this, let's complain only about the first one, and then downgrade the log level to LOG_DEBUG for the other cases. Fixes: #7188
* basic: remove redundant check (#7320)Topi Miettinen2017-11-131-1/+1
| | | | The check is redundant as the whole block is only evaluated if __IGNORE_pkey_mprotect is not defined. Change to #else.
* Merge pull request #7284 from poettering/cgroup-delegate-maskLennart Poettering2017-11-1342-201/+518
|\ | | | | add a concept of delegating cgroups per unit while enabling specific controllers
| * core: rework the Delegate= unit file setting to take a list of controller namesLennart Poettering2017-11-138-22/+246
| | | | | | | | | | | | | | | | Previously it was not possible to select which controllers to enable for a unit where Delegate=yes was set, as all controllers were enabled. With this change, this is made configurable, and thus delegation units can pick specifically what they want to manage themselves, and what they don't care about.
| * core: downgrade a log message from error to warningLennart Poettering2017-11-131-2/+2
| | | | | | | | | | Messages that do not indicate a failing operation, but where we continue operation should be at LOG_WARN, not at LOG_ERR.
| * string-util: add delete_trailing_chars() and skip_leading_chars() helpersLennart Poettering2017-11-1310-32/+92
| | | | | | | | And let's port over a couple of users to the new APIs.
| * conf-parser: reindent some strangely indented function headersLennart Poettering2017-11-131-20/+22
| |
| * conf-parser: turn three bool function params into a flags fieldsLennart Poettering2017-11-1321-91/+88
| | | | | | | | | | This makes things more readable and fixes some issues with incorrect flag propagation between the various flavours of config_parse().
| * conf-parser: simplify things a bit by using strextend()Lennart Poettering2017-11-131-11/+7
| |
| * fileio: make use of DEFINE_TRIVIAL_CLEANUP_FUNC where it makes senseLennart Poettering2017-11-131-3/+1
| |
| * cgroup: make use of unit_get_subtree_mask() where appropriateLennart Poettering2017-11-131-4/+2
| | | | | | | | | | subtree_mask is own_mask | members_mask, let's make use of that to shorten a few things
| * cgroup: improve cg_mask_to_string a bit, and add tests for itLennart Poettering2017-11-132-8/+50
| |
| * cgroup-util: add brief comments clarifying which controllers are v2-only and ↵Lennart Poettering2017-11-131-4/+4
| | | | | | | | which v1-only
| * namespace: set up OS hierarchy only after mounting the new root, not beforeLennart Poettering2017-11-131-4/+4
| | | | | | | | | | | | | | | | | | Otherwise it's a pointless excercise, as we'll set up an empty directory tree that's never going to be used. Hence, let's move this around a bit, so that we do the basesystem initialization exactly when RootImage= or RootDirectory= are used, but not otherwise.
* | install: drop redundant printing of unit name (#7296)Lennart Poettering2017-11-131-2/+2
| | | | | | | | | | | | | | We already print it as part of log_syntax() internal logic, don't print it again, and in particular, don't print it at the end of log line, such a strange place. Follow-up for: 142468d89508c63262dd59335ea6d4fe82267564
* | bpf-firewall: properly handle kernels where BPF cgroup is disabled but TRIE ↵Lennart Poettering2017-11-131-1/+26
| | | | | | | | | | | | | | | | | | maps are enabled (#7298) So far, we assumed that kernels where TRIE was on also supported BPF/cgroup stuff. That's not a correct assumption to make, hence check for both features separately. Fixes: #7054
* | Merge pull request #7310 from keszybz/missing-pkey_mprotectLennart Poettering2017-11-132-0/+32
|\ \ | |/ |/| basic/missing: add numbers for pkey_mprotect
| * shared/seccomp: skip pkey_mprotect protections if the syscall is unknownZbigniew Jędrzejewski-Szmek2017-11-131-0/+2
| | | | | | | | | | | | When compiling with an old kernel on architectures for which the number is not defined in missing.h, a warning is generated in missing.h. Let's just skip the protection in this case, to allow build to proceed.
| * basic/missing: add numbers for pkey_mprotectZbigniew Jędrzejewski-Szmek2017-11-131-0/+30
| | | | | | | | Follow-up for b835eeb4ec1dd122b6feff2b70881265c529fcdd.
* | Fix creating independent VTI tunnel (#7303)Robin McCorkell2017-11-131-1/+0
|/
* shared/seccomp: disallow pkey_mprotect the same as mprotect for W^X mappings ↵Zbigniew Jędrzejewski-Szmek2017-11-121-0/+6
| | | | | | | | | | | | | | (#7295) MemoryDenyWriteExecution policy could be be bypassed by using pkey_mprotect instead of mprotect to create an executable writable mapping. The impact is mitigated by the fact that the man page says "Note that this feature is fully available on x86-64, and partially on x86", so hopefully people do not rely on it as a sole security measure. Found by Karin Hossen and Thomas Imbert from Sogeti ESEC R&D. https://bugs.launchpad.net/bugs/1725348
* seccomp: include ARM set_tls in @default (#7297)Lennart Poettering2017-11-121-0/+1
| | | Fixes: #7135
* networkd: improve interface rename log message a bit (#7299)Lennart Poettering2017-11-121-1/+1
| | | | | | | | | | Let's clarify that it's not networkd that renames interfaces, but something else (for example, udev's link builtin based on .link files) This doesn't change any logic, it just rewords the message a bit, to clarify that we only log this for informational purposes, not because we execute the rename operation ourselves. Fixes: #7143
* Merge pull request #7301 from poettering/loginctl-ellipsizeZbigniew Jędrzejewski-Szmek2017-11-1211-32/+49
|\ | | | | | | | | | | | | | | Fix loginctl seat sysfs tree ellipsation logic. Simple reproducer: loginctl --full seat-status seat0|cat → after this PR, all lines are shown in full. Before, lines were ellipsized to terminal width.
| * loginctl: rework sysfs tree dump, to honour --full and friendsLennart Poettering2017-11-103-10/+25
| | | | | | | | | | | | | | | | | | Let's hook up the sysfs tree output with the output flags logic, already used when dumping log lines or process trees. This way we get very similar output handling for line breaking/ellipsation in all three outputs of structured data. Fixes: #7095
| * string-util: when ellipsizing to a length if (size_t) -1, become a NOPLennart Poettering2017-11-101-0/+8
| | | | | | | | | | | | | | | | | | | | Let's say that (size_t) -1 (i.e. SIZE_T_MAX) is equivalent to "unbounded" ellipsation, i.e. ellipsation as NOP. In which case the relevant functions become little more than strdup()/strndup(). This is useful to simplify caller code in case we want to turn off ellipsation in certain code paths with minimal caller-side handling for this.
| * merge two lines in our get_output_flags() functionsLennart Poettering2017-11-103-6/+3
| | | | | | | | | | | | loginctl, machinectl, systemctl all have very similar implementations of a get_output_flags() functions. Simplify it by merging two lines that set the same flag.
| * tree-wide: use _cleanup_(sd_bus_flush_close_unrefp) at various appropriate ↵Lennart Poettering2017-11-106-13/+5
| | | | | | | | | | | | places Let's shorten the code a bit.
| * pager: cache not only number of columns but also of lines before we open pagerLennart Poettering2017-11-101-2/+3
| | | | | | | | Not that we need it, but let's do this as matter of completeness.
| * loginctl: invoke sigbus_install()Lennart Poettering2017-11-102-1/+5
| | | | | | | | | | | | We show journal data, hence we should install the SIGBUS handler. Similar for machinectl, where the same applies.
* | Merge pull request #7186 from poettering/track-depsZbigniew Jędrzejewski-Szmek2017-11-1226-412/+779
|\ \ | | | | | | rework unit dependency data structure to track why deps get created
| * | core/mount: fstype may be NULLYu Watanabe2017-11-121-1/+1
| | |
| * | core: sd-bus can handle NULL strings nicely, let's use itLennart Poettering2017-11-121-6/+2
| | | | | | | | | | | | | | | No need to set an empty string here, sd-bus serializes NULL as empty string anway.
| * | core: make "tmpfs" dependencies on swapfs a "default" dep, not an "implicit"Lennart Poettering2017-11-103-27/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should be a way to turn this logic of, and DefaultDependencies= appears to be the right option for that, hence let's downgrade this dependency type from "implicit" to "default, and thus honour DefaultDependencies=. This also drops mount_get_fstype() as we only have a single user needing this now. A follow-up for #7076.
| * | core: when a unit template is specified in SYSTEMD_WANTS=, instantiate it ↵Lennart Poettering2017-11-101-4/+21
| | | | | | | | | | | | | | | | | | | | | with sysfs path This should make cases like the user's setup in #7109 a lot easier to handle, as in that case we'll do the right escaping automatically.
| * | core: remove SYSTEMD_WANTS udev property configured dependencies at the ↵Lennart Poettering2017-11-101-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | right moment Previously dependencies configured with SYSTEMD_WANTS would be collected on a device unit as long as it was loaded. let's fix that, and remove dependencies again when SYTEMD_WANTS changes.
| * | device: Let's simplify device_add_udev_wants() a bitLennart Poettering2017-11-101-4/+8
| | | | | | | | | | | | Let's drop use of one variable and make the rest more explicit.
| * | core: add internal API to remove dependencies again, based on dependency maskLennart Poettering2017-11-103-0/+98
| | | | | | | | | | | | | | | let's make use of the dependency mask, and add internal API to remove dependencies ago, based on bits in the dependency mask.
| * | device: rework device_is_bound_by_mounts() a bitLennart Poettering2017-11-101-7/+12
| | | | | | | | | | | | | | | Let's log when we can't parse the udev property, and always use the most precise, correct types.
| * | core: track why unit dependencies came to beLennart Poettering2017-11-1020-342/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the dependencies Set* objects by Hashmap* objects, where the key is the depending Unit, and the value is a bitmask encoding why the specific dependency was created. The bitmask contains a number of different, defined bits, that indicate why dependencies exist, for example whether they are created due to explicitly configured deps in files, by udev rules or implicitly. Note that memory usage is not increased by this change, even though we store more information, as we manage to encode the bit mask inside the value pointer each Hashmap entry contains. Why this all? When we know how a dependency came to be, we can update dependencies correctly when a configuration source changes but others are left unaltered. Specifically: 1. We can fix UDEV_WANTS dependency generation: so far we kept adding dependencies configured that way, but if a device lost such a dependency we couldn't them again as there was no scheme for removing of dependencies in place. 2. We can implement "pin-pointed" reload of unit files. If we know what dependencies were created as result of configuration in a unit file, then we know what to flush out when we want to reload it. 3. It's useful for debugging: "systemd-analyze dump" now shows this information, helping substantially with understanding how systemd's dependency tree came to be the way it came to be.
| * | gpt-auto-generator: make sure "r" is always setLennart Poettering2017-11-101-1/+3
| | |
| * | core: include a bad /var/run symlink in the "tainted" stringLennart Poettering2017-11-101-1/+7
| | |
| * | virt: trivial whitespace fixesLennart Poettering2017-11-101-2/+2
| |/
* | test-execute: update test for SystemCallErrorNumber=Yu Watanabe2017-11-111-2/+4
| |
* | core: allow to specify errno number in SystemCallErrorNumber=Yu Watanabe2017-11-114-12/+17
| |
* | test: add tests for syscall:errno style in SystemCallFilter=Yu Watanabe2017-11-112-9/+45
| |
* | core: add support to specify errno in SystemCallFilter=Yu Watanabe2017-11-116-35/+85
| | | | | | | | | | | | | | | | | | This makes each system call in SystemCallFilter= blacklist optionally takes errno name or number after a colon. The errno takes precedence over the one given by SystemCallErrorNumber=. C.f. #7173. Closes #7169.