Windows Version
Not tied to a Windows version (found in the source, master at eaa69e7)
WSL Version
master at eaa69e7
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
No response
Other Software
No response
Repro Steps
I noticed this while reading src/shared/configfile/configfile.cpp. Inside a value, an escaped \r is meant to be skipped as part of a CRLF line continuation, but only the \r is consumed. The \n that follows is read back by the value loop, which ends the value there.
Put this in /etc/wsl.conf with CRLF line endings (for example after editing it from Windows):
[boot]
command=echo a \
b
[network]
hostname=foo
then restart the distribution.
Expected Behavior
Same result as with LF line endings: boot.command is echo a b and the hostname is foo.
Actual Behavior
boot.command is cut to echo a , the line b is parsed as a key with no =, and because the guest parses wsl.conf without CFG_SKIP_INVALID_LINES, parsing stops at that point. Everything after the continuation (here [network] hostname) is silently ignored.
I have not run this on a live WSL install. I compiled configfile.cpp on its own on Linux against the same content and got:
LF result=0 command='echo a b' hostname='foo'
CRLF result=-1 command='echo a ' hostname=''
Diagnostic Logs
No response
Windows Version
Not tied to a Windows version (found in the source, master at eaa69e7)
WSL Version
master at eaa69e7
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
No response
Other Software
No response
Repro Steps
I noticed this while reading
src/shared/configfile/configfile.cpp. Inside a value, an escaped\ris meant to be skipped as part of a CRLF line continuation, but only the\ris consumed. The\nthat follows is read back by the value loop, which ends the value there.Put this in
/etc/wsl.confwith CRLF line endings (for example after editing it from Windows):then restart the distribution.
Expected Behavior
Same result as with LF line endings:
boot.commandisecho a band the hostname isfoo.Actual Behavior
boot.commandis cut toecho a, the linebis parsed as a key with no=, and because the guest parses wsl.conf withoutCFG_SKIP_INVALID_LINES, parsing stops at that point. Everything after the continuation (here[network] hostname) is silently ignored.I have not run this on a live WSL install. I compiled
configfile.cppon its own on Linux against the same content and got:Diagnostic Logs
No response