chiark / gitweb /
sysv-generator: Handle .sh suffixes when translating Provides:
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 20 Jan 2015 15:41:31 +0000 (16:41 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Wed, 21 Jan 2015 13:53:38 +0000 (14:53 +0100)
commit29e0e6d8c1f7f648b7c998880d034eaa3e58c53a
treea8433f8ba4bba2f9fc882b4368d67f638401368c
parent9cba813191c9e7897f7856cbe10f19600f1d56e5
sysv-generator: Handle .sh suffixes when translating Provides:

When deciding whether the provided name equals the file name in
sysv_translate_facility(), also consider them equal if the file name has a
".sh" suffix.

This was uncovered by commit b7e7184 which then created a symlink
"<name>.service" to itself for ".sh" suffixed init.d scripts.

For additional robustness, refuse to create symlinks to itself in add_alias().

Add test case which reproduces the bug.

https://bugs.debian.org/775889
src/sysv-generator/sysv-generator.c
test/sysv-generator-test.py