]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: accept '\' as escape for options separator
authorKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2023 13:40:48 +0000 (14:40 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2023 14:25:46 +0000 (15:25 +0100)
commitec1b0eb36bd6c5a5079293ab03241163f61a8bf4
tree4f4358ce38d927431a91c6ec02e2abf162d7abc3
parent2e5f5c8d85338811595d321a77647a40e12321c9
libmount: accept '\' as escape for options separator

The libmount library can accept any characters as an option value when
the value is quoted (e.g., foo="b,a,r"). However, overlayfs users have
been using '\' as an escape character (e.g., lowerdir=foo\,bar).

Although this escaping mechanism was never officially supported by
libmount/mount, it worked for the old mount(2) API because it kept the
options string unparsed for the mount(2) syscall.

The introduction of the new mount API, which utilizes fsconfig(2) per
option, has brought attention to this issue.

This patch addresses the problem by introducing official support for
'\' as an escape character for options separator.

Suggested-by: Miklos Szeredi <miklos@szeredi.hu>
References: https://lore.kernel.org/all/CAOQ4uxhgUSPkYAV8SJu-SFszkJcVO3-M4DXf46nJUtXODrPk2g@mail.gmail.com/T/#ma8e6cfc1ce7229abc089e03eed99b23b90d701e5
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit f6c29efa929cb8c741591ab38061e7921d53a997)
lib/strutils.c
libmount/src/hook_mount.c