fix(dracut-install): copy mode when use clone ioctl
This commit is contained in:
parent
4af919bec2
commit
5c9171ebe3
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
Name: dracut
|
Name: dracut
|
||||||
Version: 055
|
Version: 055
|
||||||
Release: 14
|
Release: 15
|
||||||
|
|
||||||
Summary: Initramfs generator using udev
|
Summary: Initramfs generator using udev
|
||||||
|
|
||||||
@ -102,6 +102,7 @@ Patch6051: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch
|
|||||||
Patch6052: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
|
Patch6052: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
|
||||||
|
|
||||||
Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch
|
Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch
|
||||||
|
Patch9001: fix-dracut-install-copy-mode-when-use-clone-ioctl.patch
|
||||||
|
|
||||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||||
Source2: openEuler.conf.example
|
Source2: openEuler.conf.example
|
||||||
@ -576,6 +577,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 6 2024 luhuaxin <luhuaxin1@huawei.com> - 055-15
|
||||||
|
- fix(dracut-install): copy mode when use clone ioctl
|
||||||
|
|
||||||
* Thu Jul 11 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 055-14
|
* Thu Jul 11 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 055-14
|
||||||
- add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
|
- add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch
|
||||||
|
|
||||||
|
|||||||
31
fix-dracut-install-copy-mode-when-use-clone-ioctl.patch
Normal file
31
fix-dracut-install-copy-mode-when-use-clone-ioctl.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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…
x
Reference in New Issue
Block a user