summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2015-06-30core: handle --log-target=null when calling systemd-shutdownIago López Galeiras
When shutting down, if systemd was started with --log-target=null, systemd-shutdown was being called with --log-target=console.
2015-06-23core: fix reversed dependency check in unit_check_unneededAbdo Roig-Maranges
This was introduced by commit be7d9ff730cb88d7c6a8 and breaks StopWhenUnneeded=true in the presence of a Requisite dependency.
2015-06-22smack: add default smack process label configWaLyong Cho
Similar to SmackProcessLabel=, if this configuration is set, systemd executes processes with given SMACK label. If unit has SmackProcessLabel=, this config is overwritten. But, do NOT be confused with SMACK64EXEC of execute file. This default execute process label(and also label which is set by SmackProcessLabel=) is set fork-ed process SMACK subject label and used to access the execute file. If the execution file has also SMACK64EXEC, finally executed process has SMACK64EXEC subject. While if the execution file has no SMACK64EXEC, the executed process has label of this config(or label which is set by SmackProcessLabel=). Because if execution file has no SMACK64EXEC then excuted process inherits label from caller process(in this case, the caller is systemd).
2015-06-22smack: support smack access change-ruleWaLyong Cho
Smack is also able to have modification rules of existing rules. In this case, the rule has additional argument to modify previous rule. /sys/fs/smackfs/load2 node can only take three arguments: subject object access. So if modification rules are written to /sys/fs/smackfs/load2, EINVAL error is happen. Those modification rules have to be written to /sys/fs/smackfs/change-rule. To distinguish access with operation of cipso2, split write_rules() for each operation. And, in write access rules, parse the rule and if the rule has four argument then write into /sys/fs/smackfs/change-rule. https://lwn.net/Articles/532340/ fwrite() or fputs() are fancy functions to write byte stream such like regular file. But special files on linux such like proc, sysfs are not stream of bytes. Those special files on linux have to be written with specific size. By this reason, in some of many case, fputs() was failed to write buffer to smack load2 node. The write operation for the smack nodes should be performed with write().
2015-06-17load-fragment: reset the list on an ExecStart= containing only whitespaceFilipe Brandenburger
This is consistent with how an empty string works in an ExecStart= statement. We should not differentiate between an empty string and whitespace only (since they look the same.) Update the test case with whitespace only to reflect that the list is reset. Tested that `test-unit-file` passes and other test cases are not affected. Installed the patched systemd binaries on a machine, booted it, looked for out of the usual behavior but did not find any.
2015-06-17load-fragment: use unquote_first_word in config_parse_execFilipe Brandenburger
Convert config_parse_exec() from using FOREACH_WORD_QUOTED into a loop of unquote_first_word. Loop through the arguments only once (the FOREACH_WORD_QUOTED implementation did it twice, once to count them and another time to process and store them.) Use newly introduced flag UNQUOTE_UNESCAPE_RELAX to preserve unrecognized escape sequences such as regexps matches such as "\w", "\d", etc. (Valid escape sequences such as "\s" or "\b" still need an extra backslash if literals are desired for regexps.) Differences in behavior: - Handle ; (command separator) in special, so that only ; on its own is valid for that purpose, an quoted semicolon ";" or ';' will now behave as a literal semicolon. This is probably what was initially intended. - Handle \; (to introduce a literal semicolon) in special, so that only \; is turned into a semicolon but not \\; or "\\;" or "\;" which are kept as a literal \; in the output. This is probably what was initially intended. Known issues: - Using an empty string (for example, ExecStartPre=<empty>) will empty the list and remove the existing commands, but using whitespace only (for example, ExecStartPre=<spaces>) will not. This is a pre-existing issue and will be dealt with in a follow up commit. Tested: - Unit tests passing. Also `make distcheck` still works as expected. - Installed it on a local machine and booted with it, checked console output, systemctl and journalctl output, did not notice any issues running the patched systemd binaries. Relevant bug: https://bugs.freedesktop.org/show_bug.cgi?id=90794
2015-06-17turn kdbus support into a runtime optionKay Sievers
./configure --enable/disable-kdbus can be used to set the default behavior regarding kdbus. If no kdbus kernel support is available, dbus-dameon will be used. With --enable-kdbus, the kernel command line option "kdbus=0" can be used to disable kdbus. With --disable-kdbus, the kernel command line option "kdbus=1" is required to enable kdbus support.
2015-06-17core: execute: fix regression in pam_setup()Daniel Mack
Commit 72c0a2c25 ("everywhere: port everything to sigprocmask_many() and friends") reworked code tree-wide to use the new sigprocmask_many() helper. In this, it caused a regression in pam_setup, because it dropped a line to initialize the 'ss' signal mask which is later used in sigwait(). While at it, move the variable declaration to an inner scope.
2015-06-15everywhere: port everything to sigprocmask_many() and friendsLennart Poettering
This ports a lot of manual code over to sigprocmask_many() and friends. Also, we now consistly check for sigprocmask() failures with assert_se(), since the call cannot realistically fail unless there's a programming error. Also encloses a few sd_event_add_signal() calls with (void) when we ignore the return values for it knowingly.
2015-06-14Merge pull request #189 from teg/rtnl-renameDavid Herrmann
Rename sd_rtnl to sd_netlink to prepare for further netlink-protocol support. Anything rtnl specific still uses the sd_rtnl prefix, but the generic parts (including the bus and message objects) are now called sd_netlink.
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen
2015-06-12Merge pull request #167 from keszybz/line-oriented-ima-setupkeszybz
ima-setup: write policy one line at a time
2015-06-12selinux: whitespace fixesLennart Poettering
2015-06-12core: fix CID 996302Susant Sahani
CID 996302: Error handling issues (CHECKED_RETURN)
2015-06-11Merge pull request #171 from teg/rtnl-broadcast-2David Herrmann
sd-rtnl: make joining broadcast groups implicit
2015-06-11sd-rtnl: make joining broadcast groups implicitTom Gundersen
2015-06-11kmod-setup: don't print warning on -ENOSYSDaniel Mack
-ENOSYS is returned from kmod_module_probe_insert_module() if a module isn't available, not -ENOENT. Don't spit out a warning in that case unless the warn_if_unavailable flag is set. Also factor out the condition into an own variable for better readability.
2015-06-11ima-setup: write policy one line at a timeZbigniew Jędrzejewski-Szmek
ima_write_policy() expects data to be written as one or more rules, no more than PAGE_SIZE at a time. Easiest way to ensure that we are not splitting rules is to read and write one line at a time. https://bugzilla.redhat.com/show_bug.cgi?id=1226948
2015-06-11kmod-setup: when we fail to load a kmod, log the error causeLennart Poettering
(Also, downgrade message from LOG_ERROR to LOG_WARNING, after all we don't care much and just proceed)
2015-06-11core: Let two more booleans survive a daemon-reloadWerner Fink
Without the boolean bus_name_good services as well as cgroup_realized for units a unit of Type=dbus and ExecReload sending SIGHUP to $MAINPID will be terminated if systemd will be daemon reloaded. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746151 https://bugs.freedesktop.org/show_bug.cgi?id=78311 https://bugzilla.opensuse.org/show_bug.cgi?id=934077
2015-06-10util: introduce CMSG_FOREACH() macro and make use of it everywhereLennart Poettering
It's only marginally shorter then the usual for() loop, but certainly more readable.
2015-06-10Merge pull request #85 from keszybz/selinux-contextZbigniew Jędrzejewski-Szmek
2015-06-10tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering
mask/handlers Also, when the child is potentially long-running make sure to set a death signal. Also, ignore the result of the reset operations explicitly by casting them to (void).
2015-06-09core: log oom during killing spreeThomas Hindoe Paaboel Andersen
but don't do anything else. We still want to kill as much as possible. Coverity CID#996306
2015-06-09bus-creds: always set SD_BUS_CREDS_PID when we set pid in the maskZbigniew Jędrzejewski-Szmek
Also reorder the code a bit to be easier to parse.
2015-06-08tree-wide: remove spurious spaceThomas Hindoe Paaboel Andersen
2015-06-08kmod-setup: split warn flagsDaniel Mack
Traditionally, we used to warn about ipv6 being a module or being unavailable. This was changed in b4aa82f16 ("kmod-setup: don't warn when ipv6 can't be loaded") in a way that neither of the two conditions will cause a log message. Now, while running a setup without any IPv6 is completely fine and shouldn't cause any warning, we should still warn about ipv6 being a module instead of built-in. To achieve this, split the boolean warn flag into two: one for a feature not being built-in but shipped as a module, and one to print an error when a module is entirely unavailable. We will, however, still warn if kmod returns anything else than -ENOENT in the attempt of loading the module, and at the very least, turn the message into a debug log.
2015-06-05Merge pull request #79 from zonque/fdo-87475Kay Sievers
kmod-setup: don't warn when ipv6 can't be loaded (FDO bug #87475)
2015-06-05kmod-setup: don't warn when ipv6 can't be loadedDaniel Mack
Not having IPv6 is a valid setup. Let's not print a warning in that case. Addresses: https://bugs.freedesktop.org/show_bug.cgi?id=87475
2015-06-05core: Remove "old kernel" warning if PR_SET_CHILD_SUBREAPER failsCristian Rodríguez
This made sense when systemd ran on older kernels, nowdays not so much.
2015-06-04Merge pull request #73 from zonque/mountinfoDavid Herrmann
core/mount: skip incomplete mountinfo entries
2015-06-04core/mount: skip incomplete mountinfo entriesDaniel Mack
Skip /proc/mountinfo entries for which libmount returns a NULL pointer for 'source' or 'target'. This happened on Semaphore CI's build servers when the test suite is run.
2015-06-04Partially revert "ma-setup: simplify"Zbigniew Jędrzejewski-Szmek
copy_bytes() tries to do the write in chunks, but ima kernel code needs every rule to be written in one write. Writing the whole file at once avoids the issue. http://lists.freedesktop.org/archives/systemd-devel/2015-June/032623.html http://sourceforge.net/p/linux-ima/mailman/message/34145236/ https://bugzilla.redhat.com/show_bug.cgi?id=1226948
2015-06-03kdbus: remove attach_flags_mask module parameter settingKay Sievers
2015-06-01load-fragment: use UNESCAPE_RELAX flag to parse exec directivesDaniel Mack
The cunescape() helper function used to handle unknown escaping sequences gracefully by copying them over verbatim. Commit 527b7a42 ("util: rework cunescape(), improve error handling") added a flag to make that behavior optional, and changed to default to error out with -EINVAL otherwise. However, config_parse_exec(), which is used to parse the Exec{Start,Stop}{Post,Pre,} directives of unit files, was not changed along with that commit, which means that directives with improperly escaped command line strings are no longer parsed. Relevant bugreports include: https://bugs.freedesktop.org/show_bug.cgi?id=90794 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787256 Fix this by passing UNESCAPE_RELAX to config_parse_exec() in order to restore the original behavior.
2015-05-31core/namespace: Protect /usr instead of /home with ProtectSystem=yesJason Pleau
A small typo in ee818b8 caused /home to be put in read-only instead of /usr when ProtectSystem was enabled (ie: not set to "no").
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-29path-util: Change path_is_mount_point() symlink arg from bool to flagsMartin Pitt
This makes path_is_mount_point() consistent with fd_is_mount_point() wrt. flags.
2015-05-27fix extraneous space in equality checkJonathan Boulle
2015-05-25swap: use swapon -oKarel Zak
This patch simplify swapon usage in systemd. The command swapon(8) since util-linux v2.26 supports "-o <list>". The idea is exactly the same like for mount(8). The -o specifies options in fstab-compatible way. For systemd it means that it does not have to care about things like "discard" or another swapon specific options. swapon -o <options-from-fstab> For backward compatibility the code cares about "Priority:" swap unit field (for a case when Priority: is set, but pri= in the Options: is missing). References: http://lists.freedesktop.org/archives/systemd-devel/2014-October/023576.html
2015-05-21manager: fix finish_timestamp calculationLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032100.html
2015-05-21device: never act on mount events for devices if device support is not availableLennart Poettering
2015-05-21core: properly handle jobs that are suppressed to JOB_NOPs when propagating ↵Lennart Poettering
restarts
2015-05-21util: introduce PERSONALITY_INVALID as macro for 0xffffffffLULennart Poettering
2015-05-21nspawn: finish user namespace supportLennart Poettering
2015-05-20core,nspawn: unify code that moves the root dirLennart Poettering
2015-05-19core: don't consider boot-up finished if we are still reloadingLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032025.html
2015-05-19core: when propagating restart requests due to deps, downgrade restart to ↵Lennart Poettering
try-restart Previously, if a service A depended on a service B via Requires=, and A was not running and B restarted this would trigger a start of A as well, since the restart was propagated as restart independently of the state of A. This patch ensures that a restart of B would be propagated as a try-restart to A, thus not changing its state if it isn't up. http://lists.freedesktop.org/archives/systemd-devel/2015-May/032061.html
2015-05-19core: sd_bus_error() already checks for NULL, no need to duplicate checkLennart Poettering
2015-05-19core: reinstate propagation of stop/restart jobs via RequsiteOf dependenciesLennart Poettering
This reverts the primary effect of be7d9ff730cb88d7c6a869dd5c47754c78ceaef2. After all Requisite= should be close to Requires=, without the one exception that it doesn't pull in dependencies on start. However, reverse deps on stop/restart should be treated the same way as for Restart=, and this is already documented in the man page, hence stick to it. http://lists.freedesktop.org/archives/systemd-devel/2015-May/032049.html