[systemd-devel] [PATCH] sysv-generator: Handle .sh suffixes when translating Provides:

Martin Pitt martin.pitt at ubuntu.com
Wed Jan 28 05:25:21 PST 2015


Hello Lennart,

Lennart Poettering [2015-01-28 14:19 +0100]:
> I really don't follow. Why do we need the add_alias() equality check
> now? I mean, if sysv_translate_facility() now detects if we translate
> facilities listed in Provides: as pointing to the script itself, and
> handles .sh properly, why do we need to check in add_alias() a second
> time if we try to create a symlink to oursevlves?
> 
> The latter can go no, can't it?

This should indeed not happen now with the recent fixes. This was
merely a defensive check if this situation happens with some other
corner case after committing 29e0e6d8c. But the later commit 77354c is
a stronger hammer for this, so this check is now indeed not that
important any more.

Chances are that the TOCTOU unlink will be rewritten at some point to
what you suggested (collecting the aliases in memory and writing them
after synthesizing all the units), at which point the defensiveness
might be a tad more important again, but at least now we have a rather
comprehensive test suite which ought to catch all this (like the
regression in 4e48855534 ☺ ).

So in short: if you don't like it, I'm happy to remove this.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list