chiark / gitweb /
conf-parser: Set EXTRACT_RETAIN_ESCAPE when extracting words (#2917)
authorDan Nicholson <nicholson@endlessm.com>
Mon, 18 Apr 2016 02:52:45 +0000 (19:52 -0700)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:57 +0000 (10:12 +0200)
commitb1aedf6d6e37dbc537c22dfa399da181ab21e5ec
treee7f37f5115b1899012f3fa502cbc447de9cc4525
parentd555d18278e004f0079a669150eb88dc210563c9
conf-parser: Set EXTRACT_RETAIN_ESCAPE when extracting words (#2917)

If you reference another unit with an escaped name, the escaped characters
should remain in the extracted word. This used to work correctly prior to
commit 34f253f0.

The problem can be seen when units with escaped names are referenced.

$ cat "/usr/lib/elogind/system/dev-disk-by\x2dlabel-eos\x2dswap.swap"
[Swap]
What=/dev/disk/by-label/eos-swap

[Install]
WantedBy=dev-disk-by\x2dlabel-eos\x2dswap.device

$ systemctl enable "dev-disk-by\x2dlabel-eos\x2dswap.swap"
Created symlink
/etc/elogind/system/dev-disk-byx2dlabel-eosx2dswap.device.wants/dev-disk-by\x2dlabel-eos\x2dswap.swap,
pointing to /usr/lib/elogind/system/dev-disk-by\x2dlabel-eos\x2dswap.swap.

The wants directory should be created with the x2ds escaped with \.
src/shared/conf-parser.c