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

Abierto
#1,404 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
linux, rust
Área
desktop, devops

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

现象
  • 触发条件:在默认使用 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 顶掉现有输入法。
Lenguaje dominante
Rust
Estrellas
3.7k
Forks
349
Merge medio
1 d 13 h
PR fusionados (30 d)
98

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Open-Less/openless

Todos los issues de Open-Less/openless

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.