代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2aefb506e491e0ddf1abb6a7cbb2c4137e01e47e Mon Sep 17 00:00:00 2001
From: chenyuhui <[email protected]>
Date: Mon, 1 Aug 2022 19:32:29 +0800
Subject: [PATCH 21/22] virNetDevSaveNetConfig: Pass mode to virFileWriteStr()
For some types of SRIOV interfaces we create a temporary file
where the state of the interface is saved before we start
modifying it. The file is used then to restore the original
configuration when the interface is no longer associated with any
guest. For writing the file virFileWriteStr() is used. However,
it's given wrong argument: the last argument is supposed to be
mode to create the file with but virNetDevSaveNetConfig() passes
open(2) flags (O_CREAT|O_TRUNC|O_WRONLY). We need the file to be
writable and readable by root only (0600). Therefore, pass that
mode instead of gibberish.
Signed-off-by: Michal Privoznik <[email protected]>
Reviewed-by: Peter Krempa <[email protected]>
---
src/util/virnetdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 950844b110..518eaea820 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1916,7 +1916,7 @@ virNetDevSaveNetConfig(const char *linkdev, int vf,
if (!(fileStr = virJSONValueToString(configJSON, true)))
goto cleanup;
- if (virFileWriteStr(filePath, fileStr, O_CREAT|O_TRUNC|O_WRONLY) < 0) {
+ if (virFileWriteStr(filePath, fileStr, 0600) < 0) { /* 0600: writable and readable by root */
virReportSystemError(errno, _("Unable to preserve mac/vlan tag "
"for device = %s, vf = %d"), linkdev, vf);
goto cleanup;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。