PackageKit 记录有关“only_trusted:0”的消息

PackageKit 记录有关“only_trusted:0”的消息

我跑了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任何用途, if PkTaskState::roleis PK_ROLE_ENUM_REFRESH_CACHE

在dnf后端:

  • 唯一检查PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTEDin 的地方PkBackendDnfJobData::transaction_flagspk_backend_transaction_run()
  • pk_backend_transaction_run()不是从 调用的pk_backend_refresh_cache_thread()。它仅与安装或删除软件包的作业相关。例如,它是从 调用的pk_backend_install_packages_thread()

相关内容