1 Star 0 Fork 17

MerlinDust/e2fsprogs

forked from src-anolis-os/e2fsprogs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2021-12-27 17:09 . update to e2fsprogs-1.45.6-2.el8
From 6fa8edd0fde7a540b41d78e45743208c8edab0b1 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Mon, 2 Nov 2020 15:26:31 +0100
Subject: [PATCH] mke2fs: Escape double quotes when parsing mke2fs.conf
Currently, when constructing the <default> configuration pseudo-file using
the profile-to-c.awk script we will just pass the double quotes as they
appear in the mke2fs.conf.
This is problematic, because the resulting default_profile.c will either
fail to compile because of syntax error, or leave the resulting
configuration invalid.
It can be reproduced by adding the following line somewhere into
mke2fs.conf configuration and forcing mke2fs to use the <default>
configuration by specifying nonexistent mke2fs.conf
MKE2FS_CONFIG="nonexistent" ./misc/mke2fs -T ext4 /dev/device
default_mntopts = "acl,user_xattr"
^ this will fail to compile
default_mntopts = ""
^ this will result in invalid config file
Syntax error in mke2fs config file (<default>, line #4)
Unknown code prof 17
Fix it by escaping the double quotes with a backslash in
profile-to-c.awk script.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
misc/profile-to-c.awk | 1 +
1 file changed, 1 insertion(+)
diff --git a/misc/profile-to-c.awk b/misc/profile-to-c.awk
index f964efd6..814f7236 100644
--- a/misc/profile-to-c.awk
+++ b/misc/profile-to-c.awk
@@ -4,6 +4,7 @@ BEGIN {
}
{
+ gsub("\"","\\\"",$0);
printf(" \"%s\\n\"\n", $0);
}
--
2.26.3
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/DustMerlin/e2fsprogs.git
git@gitee.com:DustMerlin/e2fsprogs.git
DustMerlin
e2fsprogs
e2fsprogs
a8

搜索帮助