Security
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
--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
用於任何事情,如果PkTaskState::role
是PK_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()
。