[insertion] Linux 包维护脚本未检查 NameHasOwner 即调用 D-Bus 导致自动激活 fcitx5 并顶掉用户现有 IBus 输入法

オープン
#1,404 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
linux, rust
領域
desktop, devops

調査の方向性

Read openless-all/app/scripts/package-linux-egui.sh at the postinst/postrm and RPM %post/%postun sections, then compare its D-Bus calls with openless-all/app/linux-egui/src/fcitx5.rs and reload_running_fcitx5(). Check whether the script can send Restart without an existing org.fcitx.Fcitx5 owner, and review the other D-Bus helpers for the same activation risk. Done when install and uninstall avoid starting fcitx5 when no owner is active, and the helper calls have been checked.

索引モデルが issue の本文から書いたものです。

説明

现象
  • 触发条件:在默认使用 IBus 中文输入法(如 Fedora 44 KDE Plasma Wayland 下的 ibus-ui-gtk3 + ibus-libpinyin)的桌面上安装或卸载 openless Linux 包。
  • 当前表现:
    1. 安装 openless 时,包内 %post / postinst 脚本向 org.fcitx.Fcitx5 发送 org.fcitx.Fcitx.Controller1.Restart 方法调用;由于未预先检查 org.fcitx.Fcitx5 是否已在当前会话运行,D-Bus(dbus-broker / dbus-daemon)直接通过 /usr/share/dbus-1/services/org.fcitx.Fcitx5.service 自动激活(D-Bus service activation)拉起了 fcitx5 守护进程。
    2. 被拉起的 fcitx5 自动加载 ibusfrontend 模块,抢占 org.freedesktop.IBus 总线并终止用户原本正在运行的 ibus-daemon 与 ibus-ui-gtk3;而新装的 fcitx5 仅有默认英文键盘,导致用户的中文输入法立即失效。
    3. 卸载 openless 时,%postun / postrm 再次调用同一命令或随依赖移除 fcitx5,使得系统中既无 fcitx5 运行、原有的 ibus 也未被恢复,用户完全丧失中文输入能力。
  • 证据:
    1. 真机 systemd 用户日志(Fedora 44 KDE Plasma Wayland):
      Nov 07 22:32:27 sudo[192754]: COMMAND=/usr/sbin/dnf install -y /home/kjin/tmp/OpenLess-Linux-egui-2.0.2-Beta.4-150-x86_64.rpm
      Nov 07 22:32:28 systemd[1283]: Started dbus-:[email protected].
      Nov 07 22:32:28 fcitx5[192820]: I2026-11-07 22:32:28.943354 instance.cpp:669] Starting fcitx5 5.1.23
      Nov 07 22:32:28 fcitx5[192820]: I2026-11-07 22:32:28.963102 addonmanager.cpp:208] Loaded addon ibusfrontend
      Nov 07 22:32:28 systemd[1283]: dbus-:[email protected]: Consumed 46.328s CPU time over 1d 52min 31.848s wall clock time
      Nov 07 22:32:28 fcitx5[192820]: I2026-11-07 22:32:28.983184 instance.cpp:405] Items in Default: [InputMethodGroupItem(keyboard-us,layout=)]
      
    2. 源码对比:
影响
  • 在使用 IBus 的 Linux 桌面(GNOME 默认、Fedora KDE 默认等)上,仅执行 apt install / dnf install 安装或卸载 openless 就会静默杀掉用户正在使用的 IBus 输入法守护进程,导致用户原有的中文等输入法立即瘫痪。
建议接受标准
  • openless-all/app/scripts/package-linux-egui.sh 中的 postinst / postrm 与 RPM %post / %postun 在向 org.fcitx.Fcitx5 发送 Restart 前,必须先检查 org.fcitx.Fcitx5 当前是否已有活跃 owner(例如先调用 org.freedesktop.DBus.NameHasOwner 返回 boolean true,或确认用户会话中有正在运行的 fcitx5 进程),绝不在 fcitx5 未运行时通过 D-Bus auto-activation 拉起新守护进程。
  • 核查 openless-all/app/linux-egui/src/fcitx5.rs 中向 org.fcitx.Fcitx5 发送消息的辅助函数(如 send_message),避免在 fcitx5 未作为当前桌面输入法运行时因热键注册等 D-Bus 调用静默激活 fcitx5 并抢占用户的 IBus 会话。
TODO / 不确定项
  • 当用户在非 fcitx5 桌面首次启动 OpenLess 时,UI 是仅提示用户需启用/切换到 fcitx5 还是按需引导,可由维护者决定;但包安装/卸载脚本不应违背自身注释约定静默拉起 fcitx5 顶掉现有输入法。
主要言語
Rust
スター
3.7k
フォーク
349
平均マージ
1日 13時間
マージ済み PR(30日)
98

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Open-Less/openless のほかの issue

Open-Less/openless の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。