]> git.ipfire.org Git - thirdparty/systemd.git/commit
fstab-generator: fix options in systemd.mount-extra= arg
authorJules Lamur <contact@juleslamur.fr>
Mon, 7 Apr 2025 16:49:26 +0000 (18:49 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Apr 2025 22:10:07 +0000 (07:10 +0900)
commit06fadc4286fee6a7505a88659e5ae2e6f3ee60ba
treeb2c4869ae3888f4f67521aecbecd431068755b55
parent5f8e5297b4699922aa003353ac1db6559805301f
fstab-generator: fix options in systemd.mount-extra= arg

Fixes a bug introduced by 55365b0a233ae3024411fd0815ad930e20f6a3d6 (v254).

The arguments `(rd.)systemd.mount-extra` take a value that looks like
`WHAT:WHERE[:FSTYPE[:OPTIONS]]`. The `OPTIONS` were parsed into a nulstr
where a comma-separated c-string was expected. This leads to a bug where
only the first option was taken into account by the generator.

For example, if you passed `systemd.mount-extra=/x:/y:baz:ro,defaults`
to the kernel, `systemd-fstab-generator` would translate that into a
nulstr: `ro\0defaults\0`.
Since methods processing options in the generator expected a
comma-separated c-string, they would only see the first option, `ro` in
this case.
src/fstab-generator/fstab-generator.c
test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-withx20space.mount
test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap
test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.wants/dev-sdy3.swap [moved from test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy3.swap with 100% similarity]