Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert [commit \#2bf46d9](2bf46d9), because `OPTIONS+="string_escape=none"` should only affect "*strings used for device naming*" [per **udev** documentation](https://www.freedesktop.org/software/systemd/man/udev.html#string_escape=none%7Creplace), e.g. strings used for setting `NAME` and `SYMLINK`.<br /> Rationale: 1. The strings *crypto-sdcard* generates and uses in [96-cryptosd.rules](https://github.com/Olf0/crypto-sdcard/blob/master/udev/rules.d/96-cryptosd.rules) for device naming should always be free of escape sequences and other "potentially dangerous" characters. If some flaw causes this not to be true anymore (e.g., see issue #115), it is fine that *udev* might filter device strings (although this mechanism makes debugging such flaws harder). 1. It did not alleviate the breakage SFOS 4.0.1. brought (issue #115). This also might prove that `string_escape=none` is not applicable to evaluating "`%c`" or inserting a string into `ENV{SYSTEMD_WANTS}=""` / `ENV{SYSTEMD_USER_WANTS}=""` statements, because the strings generated by `systemd-escape` for *crypto-sdcard* contain a lot of C-style escape sequences (or they are not considered "dangerous"). Because OTOH manually calling (at the command line) instanciated Systemd units with pre-escaped instance names works (?does it still on SFOS 4.0.1?), it is apparently the call interface proper which filters (or just misinterprets, e.g. in one of its many automatic detections) the unit string (?or just the instance name?) when handing over the content of a `ENV{SYSTEMD_WANTS}=""` / `ENV{SYSTEMD_USER_WANTS}=""` statement.
- Loading branch information
d435bbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert commit #2bf46d9
Revert commit #2bf46d9, because
OPTIONS+="string_escape=none"
should only affect "strings used for device naming" as per udev documentation, e.g. strings used for settingNAME
andSYMLINK
.Rationale
string_escape=none
is not applicable to evaluating "%c
" or inserting a string intoENV{SYSTEMD_WANTS}=""
/ENV{SYSTEMD_USER_WANTS}=""
statements, because the strings generated bysystemd-escape
for crypto-sdcard contain a lot of C-style escape sequences (or they are not considered "dangerous"). Because OTOH manually calling (at the command line) instanciated Systemd units with pre-escaped instance names works (?does it still on SFOS 4.0.1?), it is apparently the call interface proper which filters (or just misinterprets, e.g. in one of its many automatic detections) the unit string (?or just the instance name?) when handing over the content of aENV{SYSTEMD_WANTS}=""
/ENV{SYSTEMD_USER_WANTS}=""
statement.Edit / Explanation for point 2:
Systemd explicitly calls its function
extract_first_word
with the attributeEXTRACT_UNQUOTE
, hence the string handed over perENV{SYSTEMD_*WANTS}=""
from udev to Systemd (and then the separated instance string to the called unit) can be hard-quoted (per "'
"), becomes unquoted by Systemd (then still including the unit name) and should ultimately arrive at the called unit (the instance string as "%i
") as it was originally inserted intoPROGRAM=""
.In somebody else's words.