[systemd-devel] [PATCH] util: Fix assertion in split() on missing '

Martin Pitt martin.pitt at ubuntu.com
Wed Apr 22 15:20:23 PDT 2015


Hello all,

today I got a report about crashing systemd (pid 1) by installing a
package with a broken unit file. Rebooting also doesn't work as
systemd immediately crashes again. It turns out the unit file used a
multi-line ExecStart= with ' quoting where the author (accidentally)
added a trailing slash after the usual \ escaping of the newline:

---------- snip ---------
[Unit]
Description=test

[Service]
ExecStart=/bin/echo 'foo \ 
    bar'
---------- snip ---------

Instead of actually breaking your machine, you can just copy that unit
to e. g. /tmp and then run "systemd-analyze verify test.service" to
get the same assertion.

Of course this syntax is invalid, but systemd certainly shouldn't
spill its guts that hard, but just reject the broken .service file.

Simple fix with test case attached.

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-util-Fix-assertion-in-split-on-missing.patch
Type: text/x-diff
Size: 3037 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150422/31d9c791/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150422/31d9c791/attachment.sig>


More information about the systemd-devel mailing list