mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-01 05:47:04 +03:00
proc-cmdline: allow backslash escapes when parsing /proc/cmdline
So far when parsing /proc/cmdline we'd consider backslashes as mechanisms for escaping whitepace or quotes. This changes things so that they are retained as they are instead. The kernel itself doesn't allow such escaping, and hence we shouldn't do so either (see lib/cmdline.c in the kernel sources; it does support "" quotes btw). This fix is useful to allow specifying backslash escapes in the "root=" cmdline option to be passed through to systemd-fstab-generator. Example: root=/dev/disk/by-partlabel/Root\x20Partition Previously we'd eat up the "\" so that we'd then look for a device /dev/disk/by-partlabel/Rootx20Partition which never shows up. (cherry picked from commit d997861ea7dae633174cd80ab55552c020526b62) (cherry picked from commit 0e6d3243ad3c5ae719c23e14b159c27344523583) (cherry picked from commit 634c0e5e1034b58ef99bc8729db7c68219c947ab)
This commit is contained in:
parent
1e198d7617
commit
60327e0a52
@ -47,7 +47,7 @@ static int proc_cmdline_extract_first(const char **p, char **ret_word, ProcCmdli
|
||||
_cleanup_free_ char *word = NULL;
|
||||
const char *c;
|
||||
|
||||
r = extract_first_word(&q, &word, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX);
|
||||
r = extract_first_word(&q, &word, NULL, EXTRACT_UNQUOTE|EXTRACT_RELAX|EXTRACT_RETAIN_ESCAPE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user