首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pkexec -在写pkexec策略时如何为auth_admin_keep设置自定义超时

pkexec -在写pkexec策略时如何为auth_admin_keep设置自定义超时
EN

Unix & Linux用户
提问于 2017-12-08 03:58:15
回答 1查看 1.7K关注 0票数 3

我正在阅读David在freedesktop.org上为pkexec编写的参考手册:

https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html

https://www.freedesktop.org/software/polkit/docs/latest/pkexec.1.html

手册说,使用auth_admin_keep选项将只保留您的密码5到15分钟,如果我们想要设置自定义超时,我们有写自定义规则。

有人知道我如何为超时编写自定义规则吗?我试着跟随手册,但我不是一个程序员,我无法理解synthax,也没有提到与超时相关的synthax。

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2018-07-25 04:39:56

不幸的是,超时似乎在PolicyKit上游源文件中src/polkitbackend/polkitbackendinteractiveauthority.c中被硬编码为5分钟。

在第3231-3236行上,它说:

代码语言:javascript
复制
/* TODO: right now the time the temporary authorization is kept is hard-coded - we
 *       could make it a propery on the PolkitBackendInteractiveAuthority class (so
 *       the local authority could read it from a config file) or a vfunc
 *       (so the local authority could read it from an annotation on the action).
 */
 expiration_seconds = 5 * 60;

因此,在源代码中将超时设置为5分钟,目前没有关于在不重新编译PolicyKit的适当部分之前对其进行更改的规定。

另一方面,OpenSuSE Leap 15似乎扩展了这一功能.似乎重新解释了..._keep操作,意思是“在请求进程运行时记住身份验证”,并添加了..._keep_session..._keep_always操作,分别表示“记住整个特定的登录会话”和“永远记住”。

票数 4
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/409636

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档