代码拉取完成,页面将自动刷新
From df915cbcc72f0ac8c220e40a62eb6da050057c3e Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 4 Jul 2024 19:39:36 +0800
Subject: [PATCH 19/22] fix(systeminfo): Remove the duplicate graphical and
network hardware info.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除重复的显卡和网络设备
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
plugins/systeminfo/systeminfo-hardware.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plugins/systeminfo/systeminfo-hardware.cpp b/plugins/systeminfo/systeminfo-hardware.cpp
index 73960f7..8ccb0e4 100644
--- a/plugins/systeminfo/systeminfo-hardware.cpp
+++ b/plugins/systeminfo/systeminfo-hardware.cpp
@@ -355,6 +355,10 @@ KVList SystemInfoHardware::get_pcis_by_major_class_id(PCIMajorClassID major_clas
// 如果为空则不执行下面的命令,否则会取到所有的PCI设备(没有了-d选项的限制)
RETURN_VAL_IF_TRUE(full_class_ids.size() == 0, KVList());
+ // 对full_class_ids去重
+ std::sort(full_class_ids.begin(), full_class_ids.end());
+ full_class_ids.erase(std::unique(full_class_ids.begin(), full_class_ids.end()), full_class_ids.end());
+
// 根据full_class_id列表获取设备相关信息
std::string full_outputs;
for (auto& full_class_id : full_class_ids)
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。