chiark / gitweb /
systemd: fix NULL dereference when disabling a nonexistent instance
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Jul 2013 03:36:14 +0000 (23:36 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Jul 2013 03:53:45 +0000 (23:53 -0400)
Assertion 'p' failed at src/shared/path-util.c:51, function path_get_file_name(). Aborting.

The unit file could not be found, and i->path would not be set.
In 02b9e969 a code path was added which attempts to remove symlinks
to a nonexistent (removed) unit file. This worked OK in case of
non-instance services, but broke in the case of instance services.

Behaviour wrt. to instance units is changed in the way that 02b9e969
changed it for non-instance units: it is now possible to remove
instance symlinks to a template unit that has been removed.

This patch isn't a full fix, because the behaviour wrt. to enabling
and disabling instance units is still broken: e.g it is possible to
start autovt@tty5.service, but it is not possible to enable it,
because autovt@.service is a symlink, and on the other hand, disabling
getty@tty5.service removes all symlinks to getty@.service, which is
wrong too. But segfaults make bad pr, so let's add at least this
partial fix for now.


No differences found