13 Star 0 Fork 6

ocs-commit/dbus-broker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
4fa73fd2dc8429ff0fbbda39bce8e8af92681b07.patch 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-12-25 11:18 . - Apply patches from rpm-tracker
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);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit/dbus-broker.git
git@gitee.com:ocs-commit/dbus-broker.git
ocs-commit
dbus-broker
dbus-broker
master

搜索帮助