![PackageKit 记录有关“only_trusted:0”的消息](https://linux22.com/image/151461/PackageKit%20%E8%AE%B0%E5%BD%95%E6%9C%89%E5%85%B3%E2%80%9Conly_trusted%3A0%E2%80%9D%E7%9A%84%E6%B6%88%E6%81%AF.png)
我跑了pkcon update force
。我注意到 PackageKit 正在记录有关only_trusted:0
.即,only_trusted
禁用该选项的操作。虽然我没有--allow-untrusted
传到pkcon
。
PackageKit[19819]: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
所以 PackageKit 正在编写一条关于允许不受信任的包的日志消息。我不希望它这样做。我没有要求它这样做。为什么要记录此消息? PackageKit有问题吗?
$ sudo systemctl status packagekit.service
● packagekit.service - PackageKit Daemon
Loaded: loaded (/usr/lib/systemd/system/packagekit.service; static; vendor preset: disabled)
Active: active (running) since Mon 2019-04-08 12:34:58 BST; 1min 29s ago
Main PID: 19819 (packagekitd)
Tasks: 3 (limit: 4915)
Memory: 192.7M
CGroup: /system.slice/packagekit.service
└─19819 /usr/libexec/packagekitd
Apr 08 12:34:58 alan-laptop PackageKit[19819]: daemon start
Apr 08 12:34:58 alan-laptop systemd[1]: Starting PackageKit Daemon...
Apr 08 12:34:58 alan-laptop systemd[1]: Started PackageKit Daemon.
Apr 08 12:34:58 alan-laptop PackageKit[19819]: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
Apr 08 12:34:58 alan-laptop PackageKit[19819]: uid 1000 obtained auth for org.freedesktop.packagekit.system-sources-refresh
Apr 08 12:35:09 alan-laptop PackageKit[19819]: refresh-cache transaction /17652_eabaebee from uid 1000 finished with success after 11018ms
$ rpm -q PackageKit
PackageKit-1.1.12-2.fc29.x86_64
答案1
该--allow-untrusted
选项和only_trusted
标志在刷新时不相关。
仅当您请求安装或升级(或删除,可能?)软件包时,它们才相关。
在客户端:
pk-console.c
始终检查pkcon
命令是否与 一起运行--allow_untrusted
,并相应地设置only_trusted
的属性pk_task
。然而:pk_task_refresh_cache_async()
忽略该pk_task
属性,并无条件PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED
设置PkTaskState::transaction_flags
。- 然后调用
pk_task_do_async_action()
.但该函数实际上并没有PkTaskState::transaction_flags
任何用途, ifPkTaskState::role
isPK_ROLE_ENUM_REFRESH_CACHE
。
在dnf后端:
- 唯一检查
PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED
in 的地方PkBackendDnfJobData::transaction_flags
是pk_backend_transaction_run()
。 pk_backend_transaction_run()
不是从 调用的pk_backend_refresh_cache_thread()
。它仅与安装或删除软件包的作业相关。例如,它是从 调用的pk_backend_install_packages_thread()
。