summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-06-03test-unit-file.c: fixup the test for commit 3b51f8ddd5Harald Hoyer
2015-06-03util: fix another cunescape() regressionDaniel Mack
Fix a regression caused by 4034a06d ("util: rework word parsing and c unescaping code") which broke octal escape sequences. The reason for this breakage is that cunescape_one() expects 4 characters in an octal encoding, which is a stray left-over from the old code which operated on different variables to make the length check. While at it, add a test case to prevent the same thing from happening again.
2015-06-03udevd: merge manager_new() and manager_listen() againTom Gundersen
Now that listen_fds() have been split out, we can safely move the allocation of the manager object after doing the forking (the fork is done to notify legcay init-systems that the fds are ready). Subsequently, we can merge manager_listen() back into managre_new(). This entails a minor behaviour change: the application of permissions to static device nodes now happens after the fork (but still before notifying systemd about being ready).
2015-06-03udevd: make sd_notify independent of forknig/notify modeTom Gundersen
This will simply silently fail on non-systemd systems, so there is no reason to make it conditional. Also make it clear that we notify systemd about being ready as the last step before starting the event loop, whereas the forking might need to happen earlier.
2015-06-03udevd: manager - split listen_fds() out of manager_new()Tom Gundersen
This will allow us in a follow-up commit to listen to fds before forking and still allocate the manager only after the fork.
2015-06-03udevd: unify fd handling in forking/notify modesTom Gundersen
Hide the differenec in listen_fds, by simply opening the fds here in case they are not passed in.
2015-06-03libudev: monitor - set nl_pid when reusing fd in ↵Tom Gundersen
udev_monitor_new_from_netlink_fd This allows a fd to be created and configured as part of one monitor, to be passed in to create a second monitor without having to redo any of the configuration.
2015-06-03udevd: make cgroup logic independent of socket passingTom Gundersen
This should have no behavioural change, but it is odd to tie the cgroup cleaning to whether or not we are passed sockets. The point really is if we are guaranteed to be in a dedicated cgroup, so instead check for our parent being PID1 (we already implicitly only do this on systemd systems).
2015-06-03udevd: only bind ctrl and netlink sockets when we open themTom Gundersen
If they are passed from PID1 this is not necessary.
2015-06-03udevd: rename systemd_fds to listen_fdsTom Gundersen
2015-06-03udevd: simplify signal mask handlingTom Gundersen
We used to block all signals, and restore the original signal mask before exec'ing external processes. Now we just block the signals we care about and unconditionally unblock all signals before exec'ing.
2015-06-03Merge pull request #41 from mischief/ipforwardingTom Gundersen
networkd: create "kernel" setting for IPForwarding
2015-06-02networkd: create "kernel" setting for IPForwardingNick Owens
In 5a8bcb674f71a20e95df55319b34c556638378ce, IPForwarding was introduced to set forwarding flags on interfaces in .network files. networkd sets forwarding options regardless of the previous setting, even if it was set by e.g. sysctl. This commit creates a new option for IPForwarding, "kernel", that preserves the sysctl settings rather than always setting them. See https://bugs.freedesktop.org/show_bug.cgi?id=89509 for the initial bug report.
2015-06-03udev: input_id - use ABS_MT_SLOT{-1} to exclude non touch screen devicesAndreas Pokorny
Peek at the ABS_MT_SLOT-1 axis. Expect that touch screens only have axes inside the MT range.
2015-06-03udev: input_id - use direct property and mt axis for touch screen detectionAndreas Pokorny
A lot of touch screens use INPUT_PROP_DIRECT to indicate that touch input maps directly to the underlying screen, while the BTN_TOUCH bit might not be set.
2015-06-03udev: input_id - refactor device detectionAndreas Pokorny
This change switches to bools and separates bit flag evaluation from decision making and application of udev properties, while hopefully keeping the same semantics. Apart from using BTN_LEFT instead of BTN_MOUSE for mouse detection.
2015-06-03remove gudev and gtk-docKay Sievers
The library moved to: https://git.gnome.org/browse/libgudev/
2015-06-02fix double semicolon typoThomas Hindoe Paaboel Andersen
2015-06-02Merge pull request #12 from ↵Tom Gundersen
systemd-mailing-devs/1433236104-9967-1-git-send-email-m.olbrich@pengutronix.de missing: add more btrfs defines
2015-06-02udev-builtin: path_id - don't pass NULL to udev_device_get_parent()Tom Gundersen
Being explicit about this makes the code easier to follow IMHO.
2015-06-02udev: add some assertsTom Gundersen
Mostly for documentation purposes.
2015-06-02sd-device: get_driver - remember if a device does not have a driverTom Gundersen
Don't try to read it again.
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-02missing: add more btrfs definesMichael 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.