[systemd-devel] Crash with extra space after Exec prefix

Martin Pitt martin.pitt at ubuntu.com
Wed May 13 08:01:53 PDT 2015


Hello all,

I got a report [1] that you can trivially crash systemd (pid1) at boot
by creating a unit with an Exec= line with a modifier and a space:

$ cat /tmp/foo.service
[Service]
ExecStart=- /bin/echo hello

$ systemd-analyze verify /tmp/foo.service
Assertion 'skip < l' failed at ../src/core/load-fragment.c:607, function config_parse_exec(). Aborting.
Aborted (core dumped)

systemd pid 1 will crash the same way at boot, but with
systemd-analyze it's less harmful to test :-)

So, obviously we need to fix the crash; but I was wondering what the
desired behaviour should be? In the sense of "be liberal what you
accept" I think the extra space(s) should just be ignored; or should
that count as an error and the unit get rejected?

Thanks,

Martin

[1] https://launchpad.net/bugs/1454173
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list