1 Star 0 Fork 1

chairou/PackageKit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
package-remove-password-prompt.patch 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
chair 提交于 2023-11-27 20:10 . PackageKit Init
From 8914e11968a934faa651311fd98a98a3a19218ae Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 3 Jun 2020 10:45:12 -0500
Subject: [PATCH] Allow admin users to remove packages without password prompt
A local, active admin user can install packages without a password
prompt, but has to enter the admin password to remove packages. This
doesn't make much sense. It should be parallel.
Note that this change has no effect on what users are able to do,
because it only applies to admin users. The password only protects
against unlocked workstation attackers, where an attacker gains physical
access to an unlocked desktop. It's pretty weird to prevent such an
attacker from removing software, but allow installing new stuff.
https://pagure.io/fedora-workstation/issue/233
---
policy/org.freedesktop.packagekit.rules | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/policy/org.freedesktop.packagekit.rules b/policy/org.freedesktop.packagekit.rules
index 6a1c8a701..95d21925f 100644
--- a/policy/org.freedesktop.packagekit.rules
+++ b/policy/org.freedesktop.packagekit.rules
@@ -1,5 +1,6 @@
polkit.addRule(function(action, subject) {
- if (action.id == "org.freedesktop.packagekit.package-install" &&
+ if ((action.id == "org.freedesktop.packagekit.package-install" ||
+ action.id == "org.freedesktop.packagekit.package-remove") &&
subject.active == true && subject.local == true &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chairou/PackageKit.git
git@gitee.com:chairou/PackageKit.git
chairou
PackageKit
PackageKit
master

搜索帮助