summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-06-02sd-device: get_subsystem - don't complain if a device does not have a subsystemTom Gundersen
2015-06-02Merge pull request #8 from ↵Martin Pitt
systemd-mailing-devs/1433236059-9824-1-git-send-email-m.olbrich@pengutronix.de random-util: guard including sys/auxv.h with the corresponding ifdef …
2015-06-0290-loaderentry.install: fixup BOOT_OPTIONSHarald Hoyer
better use "read -r -d '' -a" to read in the array. It handles multiple lines and missing newline at the EOF.
2015-06-02random-util: guard including sys/auxv.h with the corresponding ifdef checkMichael Olbrich
2015-06-01test-unit-file: add test for improperly escaped exec stringDaniel Mack
Add a regression test for the recent breakage of handling improperly escaped exec strings in unit files. Code contributed by Martin Pitt: https://bugs.freedesktop.org/show_bug.cgi?id=90794
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-06-01sd-device: ensure update_properties_buf() is a noop on failureTom Gundersen
Don't clobber the sd_device struct, and don't leak memory when memory allocation fails.
2015-06-01sd-device: fix invalid property strv pointersMartin Pitt
In device_update_properties_bufs(), the strv is built from pointers into the single nul-terminated buf_nulstr string, to avoid allocating the key=value strings twice. However, we must not do that while building and GREEDY_REALLOC0()'ing buf_nulstr, as each time when this actually reallocates memory the pointers we wrote into buf_strv so far become invalid. So change the logic to first completely build the new buf_nulstr, and then iterate over it to pick out the pointers to the individual key=value strings for properties_strv. This fixes invalid environment for udev callouts.
2015-05-31udevd: open sockets before forkingTom Gundersen
The communication channels must all be opened before forknig in daemon mode, or we cannot guarantee that udevadm will work correctly as soon as udevd is started.
2015-05-31udevd: don't allocate sd_event object before forkTom Gundersen
In daemon mode we would break sd-event as it cannot work accross different processes. Simply delay the allocation to after the fork.
2015-05-31udevd: don't sanitize fd 0,1,2Tom Gundersen
Kay said: 'it is from ancient times, when we started udevd from the kernel's usermodhelper which had no fd 0,1,2'.
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-30conf-parser: parsing error logs should show a type not a vartypeRonny Chevalier
Instead of this: [filename:1] Failed to parse nsec_t value, ignoring: garbage we show this: [filename:1] Failed to parse nsec value, ignoring: garbage
2015-05-30networkctl: fix uninitialized variableRonny Chevalier
We ignore the return value of sd_device_get_devtype, then devtype could be uninitialized when used with streq_ptr. So we need to initialize it first.
2015-05-30test-fdset: add more testsRonny Chevalier
add tests for the following functions: - fdset_new_array - fdset_steal_first - fdset_isempty
2015-05-30tests: add test-conf-parserRonny Chevalier
2015-05-30terminal: fix include orderingThomas Hindoe Paaboel Andersen
2015-05-29console: use signal-util.h and reorder includesThomas Hindoe Paaboel Andersen
Missed this one from the previous commit
2015-05-29terminal: use signal-util.h and reorder includesThomas Hindoe Paaboel Andersen
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-29udevd: notify - expose a bit more of the internal stateTom Gundersen
This notifies PID1 about config being flushed, about shutdown starting and shutdown finalizing.
2015-05-29udevd: notify - keep NOTIFY_SOCKET aroundTom Gundersen
Only unset the env var in the workers, but otherwise keep it around in the main daemon.
2015-05-29udevd: modernize status notificationTom Gundersen
Only log about starting in daemon mode, rely on PID1 to log this in notify mode. Also explicitly set the STATUS variable, as is done in notify mode as is done for other serivecs.
2015-05-29udevd: event - port spawn_wait() to sd-eventTom Gundersen
This allows us to drop the special sigterm handling in spawn_wait() as this will now be passed directly to the worker event loop. We now log failing spawend processes at 'warning' level, and timeouts are in terms of CLOCK_BOOTTIME when available, otherwise the behavior is unchanged.
2015-05-29udevd: move main-loop to sd-eventTom Gundersen
2015-05-29udevd: explicitly try to start event queue when it may be possibleTom Gundersen
Rather than trying to schedule new events on every main-loop iteration, do it explicitly when processing an event finishes, a worker is killed, a new uevent is received, or the event queue is explicitly restarted.
2015-05-29udevd: only check for changed config before scheduling new eventsTom Gundersen
Also move builtin and rules initialization from main loop to event_queue_start(). No functional change.
2015-05-29udevd: introduce manager_exit() and manager_reload()Tom Gundersen
The behavior is mostly unchanged, but rather than only ever calling these functions at fixed points in the event loop, they are called directly whenever they are invoked.
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-29path-util: Fix path_is_mount_point for filesMartin Pitt
Commits 27cc6f166 and f25afeb broke path_is_mount_point() for files (such as /etc/machine-id → /run/machine-id bind mounts) as with the factorization of fd_is_mount_point() we lost the parent directory. We cannot determine that from an fd only as openat(fd, "..") only works for directory fds. Change fd_is_mount_point() to behave like openat(): It now takes a file descriptor of the containing directory, a file name in it, and flags (which can be 0 or AT_SYMLINK_FOLLOW). Unlike name_to_handle_at() or openat(), fstatat() only accepts the inverse flag AT_SYMLINK_NOFOLLOW and complains with EINVAL about AT_SYMLINK_FOLLOW; so we need to transform the flags for that fallback. Adjust rm_rf_children() accordingly (only other caller of fd_is_mount_point() aside from path_is_mount_point()). Add test cases for files, links, and file bind mounts (the latter will only work when running as root). Split out a new test_path_is_mount_point() test case function as it got significantly larger now.
2015-05-28systemctl: Don't skip SysV init.d scripts when enabling/disabling unitsMartin Pitt
If there is both a SysV init.d script and a systemd unit for a given name, we want to do the same enable/disable operation for both, instead of just on the systemd unit. This keeps the enablement status in sync so that switching init systems behaves as expected.
2015-05-28systemctl: drop hardcoded chkconfig invocationMartin Pitt
Introduce /usr/lib/systemd/systemd-sysv-install [--root=] <action> <name> abstraction, replacing the direct calling of chkconfig. This allows distributions to call their specific tools like update-rc.d without patching systemd. Ship systemd-sysv-install.SKELETON as an example for packagers how to implement this. Drop the --enable-chkconfig configure option. Document this in README and point to it in NEWS.
2015-05-28sd-device: enumerator - fix matching on properties and sysattrsTom Gundersen
This was a regression that broke $ udevadm trigger -nv --property-match=DEVNAME=/dev/sda1 --attr-match=size=409600 Reported by David Reisner.
2015-05-27fix extraneous space in equality checkJonathan Boulle
2015-05-27sd-device: fix device_get_properties_strv()Tom Gundersen
A NULL pointer was inserted as the first element of the strv. This had the effect of always passing the empty environment to processes spawned by udev. Reported by Michał Bartoszkiewicz.
2015-05-27udevd: fix SIGCHLD handling in --daemon modeTom Gundersen
We were listening for SIGCHLD in the wrong process.
2015-05-27missing: add more IFLA_VXLAN_* definesMichael Olbrich
Otherwise building faild with kernel headers < v3.16
2015-05-27logind: prefix some calls to unlink with (void)Daniel Mack
Make Coverity happy and tell it we're not interested in the return value of these two calls.
2015-05-27logind: unlink /run/nologin when shutdown is cancelledDaniel Mack
When a scheduled is cancelled, make sure to remove /run/nologin. This is a regression from the recent shutdownd removal and logind rework.
2015-05-26treewide: fix typosTorstein Husebø
2015-05-26udev: fix inotify handlingDavid Herrmann
This partly reverts: commit 6d1b1e0bc6bd020218afc5f05286bf372be283d5 Author: Tom Gundersen <teg@jklm.no> Date: Sun May 24 15:10:04 2015 +0200 udevd: worker - fully clean up unnecessary fds The inotify-fd _is_ used in the workers, so don't close it! Have a look at udev-watch.c, which keeps track of the inotify-fd as a global variable (ugh!).
2015-05-25test: hostname - test that hostname is truly initializedTom Gundersen
Fixes CID CID 1299638 (use after free).
2015-05-25nspawn: fix memleakTom Gundersen
This was a typo, swapping prefix_root() in place of prefix_roota(). Fixes CID 1299640.
2015-05-25nspawn: avoid memleakTom Gundersen
Simplify the code a bit, at the cost of potentially duplicating some memory unneccessarily. Fixes CID 1299641.
2015-05-25nspawn: drop some debugging codeTom Gundersen
These have no effect. Fixes CID 1299643.
2015-05-25import: dkr - avoid NULL-pointer dereferenceTom Gundersen
A malformed manifest could in principle cause a NULL pointer dereference of. Check for this and fail early. Fixes CID 1299642.
2015-05-25nspawn: make coverity happyTom Gundersen
Rather than checking the return of asprintf() we are checking if buf gets allocated, make it clear that it is ok to ignore the return value. Fixes CID 1299644.
2015-05-25networkd: fix IFF_UP when ipv6 support is disabledTom Gundersen
Passing ipv6 options (even when they should be noops) caused IFF_UP to fail when ipv6 was supported. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90103
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-24shared: generator - correct path to systemd-fsckMike Gilbert
In generated systemd-fsck-root.service. This would break if rootprefix is not /usr/lib/systemd. [tomegun: flesh out commit message]