14 Star 0 Fork 32

src-openEuler/dracut

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-dracut-install-copy-mode-when-use-clone-ioctl.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
From a1c9480ac9791eb961507b44b7c0813a9ffd4ca4 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Wed, 21 Aug 2024 14:51:53 +0800
Subject: [PATCH] fix(dracut-install): copy mode when use clone ioctl
When use clone ioctl to copy a file, the mode of files are missing,
which is inconsistent with the result by using the cp command.
This commit add the process to set mode after clone_file().
Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
---
src/install/dracut-install.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 291c70a..47b799e 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -363,6 +363,9 @@ static int cp(const char *src, const char *dst)
log_info("Failed to chown %s: %m", dst);
}
+ if (fchmod(dest_desc, sb.st_mode) != 0)
+ log_error("Failed to chown %s: %m", dst);
+
if (geteuid() == 0 && no_xattr == false) {
if (copy_xattr(dest_desc, source_desc) != 0)
log_error("Failed to copy xattr %s: %m", dst);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/dracut.git
git@gitee.com:src-openeuler/dracut.git
src-openeuler
dracut
dracut
master

搜索帮助