代码拉取完成,页面将自动刷新
同步操作将从 OpenCloudOS Stream/dbus-broker 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4fa73fd2dc8429ff0fbbda39bce8e8af92681b07 Mon Sep 17 00:00:00 2001
From: David Rheinsberg <david@readahead.eu>
Date: Thu, 1 Aug 2024 14:56:40 +0200
Subject: [PATCH] launch/policy: prevent linking policies on invalid gids
Invalid groups/users are reported as `-1` by the config parser, and
generally ignored by the policy import. Unfortunately, the own-policy
importer does not check for it when importing into groups. Fix this and
align it with `policy_import_send/recv`.
Signed-off-by: David Rheinsberg <david@readahead.eu>
---
src/launch/policy.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/launch/policy.c b/src/launch/policy.c
index 803336fc..97f1bf1a 100644
--- a/src/launch/policy.c
+++ b/src/launch/policy.c
@@ -396,11 +396,13 @@ static int policy_import_own(Policy *policy, ConfigNode *cnode) {
} else if (cnode->parent->policy.context == CONFIG_POLICY_AT_CONSOLE) {
c_list_link_tail(&policy->at_console_entries.own_list, &record->link);
} else if (cnode->parent->policy.context == CONFIG_POLICY_GROUP) {
- r = policy_at_gid(policy, &node, cnode->parent->policy.id);
- if (r)
- return error_trace(r);
+ if (cnode->parent->policy.id != (uint32_t)-1) {
+ r = policy_at_gid(policy, &node, cnode->parent->policy.id);
+ if (r)
+ return error_trace(r);
- c_list_link_tail(&node->entries.own_list, &record->link);
+ c_list_link_tail(&node->entries.own_list, &record->link);
+ }
} else {
c_list_link_tail(&policy->default_entries.own_list, &record->link);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。