代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。