Bug#820359: init-system-helpers: Handle \ escape in systemd unit names

Dan Nicholson nicholson at endlessm.com
Fri Apr 8 17:32:46 BST 2016


On Thu, Apr 7, 2016 at 12:27 PM, Dan Nicholson <nicholson at endlessm.com> wrote:
> On Thu, Apr 7, 2016 at 11:56 AM, Felipe Sateler <fsateler at debian.org> wrote:
>>
>> AFAICT, the only difference between quotewords and split is that
>> quotewords takes into account quotes to allow "multiple words" to be
>> parsed as a single token. I don't think we have use for such a feature
>> (there are no such files in the archive).
>>
>> So, unless I'm missing something, this could be further simplified to
>> just use split.
>
> Yeah, that does seem possible. The only fields parsed are WantedBy,
> RequiredBy, Also and Alias. Since the values here are unit names,
> there shouldn't be any instances where there's valid whitespace in the
> words. So, I think you could do split followed by quote stripping and
> everything would be fine. I'll try that out.
>
> Of course, if init-system-helpers ever does parse any fields might
> contain contain multiple quoted words, then you'd need to go back to
> using quotewords or something like that.

The attached patch seems to work in my testing.

--
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-script-Handle-escapes-in-unit-names-properly.patch
Type: text/x-patch
Size: 5184 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20160408/33321114/attachment-0002.bin>


More information about the Pkg-systemd-maintainers mailing list