我正在阅读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。
发布于 2018-07-25 04:39:56
不幸的是,超时似乎在PolicyKit上游源文件中src/polkitbackend/polkitbackendinteractiveauthority.c。中被硬编码为5分钟。
在第3231-3236行上,它说:
/* 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操作,分别表示“记住整个特定的登录会话”和“永远记住”。
https://unix.stackexchange.com/questions/409636
复制相似问题