1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

Merge b3c5a35509bbd0c3f19c25c4a52d504ada824f30 into fdab24bf6acc62d3011f9b5abdf834b4886642b2

This commit is contained in:
Paweł Zmarzły 2025-03-13 06:17:50 +01:00 committed by GitHub
commit 9e917d02af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -857,7 +857,7 @@ int mount_option_mangle(
_cleanup_free_ char *word = NULL;
const struct libmnt_optmap *ent;
r = extract_first_word(&p, &word, ",", EXTRACT_KEEP_QUOTE);
r = extract_first_word(&p, &word, ",", EXTRACT_KEEP_QUOTE | EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return r;
if (r == 0)

View File

@ -81,6 +81,11 @@ TEST(mount_option_mangle) {
assert_se(f == 0);
ASSERT_STREQ(opts, "mode=01777,size=10%,nr_inodes=400k,uid=496107520,gid=496107520,context=\"system_u:object_r:svirt_sandbox_file_t:s0:c0,c1\"");
opts = mfree(opts);
assert_se(mount_option_mangle("lower=/path/one/with/some\\:colons:/path/two", 0, &f, &opts) == 0);
assert_se(f == 0);
ASSERT_STREQ(opts, "lower=/path/one/with/some\\:colons:/path/two");
opts = mfree(opts);
}
static void test_mount_flags_to_string_one(unsigned long flags, const char *expected) {