-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add polkit support #121
Conversation
As title. Log: enhance security Task: https://pms.uniontech.com/task-view-355353.html
deepin pr auto review关键摘要:
是否建议立即修改: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look's good
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: re2zero, wangrong1069 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/forcemerge |
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | ||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> | ||
<policyconfig> | ||
<action id="com.deepin.anything"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action id最好在后面加一个具体行为,比如com.deepin.anything.access-file-index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非安全性问题, 后期会整改
@@ -1639,3 +1680,23 @@ int LFTManager::_doSearch(void *vbuf, quint32 maxCount, const QString &path, con | |||
|
|||
return total; | |||
} | |||
|
|||
bool LFTManager::checkAuthorization(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个action的提示信息是"访问文件索引需要认证",看起来不能满足所有接口的提示,建议定义多个action,这个方法加一个actionId参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非安全性问题, 后期会整改
PolkitQt1::Authority::Result result; | ||
|
||
result = PolkitQt1::Authority::instance()->checkAuthorizationSync(actionId, | ||
PolkitQt1::SystemBusNameSubject(appBusName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考systemd代码:https://github.com/systemd/systemd/blob/main/src/shared/bus-polkit.c#L84
作为服务,subject应该用caller生成
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的确是使用 sender 来进行身份验证.
这里的 QDBusMessage::service() 来自于 q_dbus_message_get_sender().
As title.
Log: enhance security
Task: https://pms.uniontech.com/task-view-355353.html