[insertion] Linux 包维护脚本未检查 NameHasOwner 即调用 D-Bus 导致自动激活 fcitx5 并顶掉用户现有 IBus 输入法
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
现象
- 触发条件:在默认使用 IBus 中文输入法(如 Fedora 44 KDE Plasma Wayland 下的
ibus-ui-gtk3+ibus-libpinyin)的桌面上安装或卸载openlessLinux 包。 - 当前表现:
- 安装
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守护进程。 - 被拉起的
fcitx5自动加载ibusfrontend模块,抢占org.freedesktop.IBus总线并终止用户原本正在运行的ibus-daemon与ibus-ui-gtk3;而新装的fcitx5仅有默认英文键盘,导致用户的中文输入法立即失效。 - 卸载
openless时,%postun/postrm再次调用同一命令或随依赖移除fcitx5,使得系统中既无fcitx5运行、原有的ibus也未被恢复,用户完全丧失中文输入能力。
- 安装
- 证据:
- 真机 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=)] - 源码对比:
openless-all/app/linux-egui/src/fcitx5.rs的reload_running_fcitx5()注释明确写道:“Only an instance that currently owns theorg.fcitx.Fcitx5DBus name is restarted... so we never force-spawn a daemon”,并在调用Restart前先调用了fcitx5_name_has_owner()(org.freedesktop.DBus.NameHasOwner):
https://github.com/Open-Less/openless/blob/c002b56c38d81bcd5044ddb22597a4e78ff2a88d/openless-all/app/linux-egui/src/fcitx5.rs#L1185-L1200openless-all/app/scripts/package-linux-egui.sh的注释同样要求 “Reconnect only to existing user DBus sessions; never start a daemon”,但实际脚本直接执行了dbus-send --session --dest=org.fcitx.Fcitx5 --type=method_call /controller org.fcitx.Fcitx.Controller1.Restart,未先检查NameHasOwner,从而触发了 D-Bus 自动激活:
https://github.com/Open-Less/openless/blob/c002b56c38d81bcd5044ddb22597a4e78ff2a88d/openless-all/app/scripts/package-linux-egui.sh#L78-L96
https://github.com/Open-Less/openless/blob/c002b56c38d81bcd5044ddb22597a4e78ff2a88d/openless-all/app/scripts/package-linux-egui.sh#L191-L212
- 真机 systemd 用户日志(Fedora 44 KDE Plasma Wayland):
影响
- 在使用 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顶掉现有输入法。
- Ngôn ngữ chính
- Rust
- Star
- 3.7k
- Fork
- 349
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 98
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Open-Less/openless
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[windows] 录音快捷键还不支持设置为ScrllLock键Có thể đã có người làm @HKLHaoBin đã nhận 14 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Open-Less/openless#1241 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ui bug P2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Open-Less/openless
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
RustCrypto/utils#1597 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Non-`main` default branchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
max-sixty/worktrunk#4727 · 7 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
carrick-sh/carrick#1859 ·
Maintainer thường phản hồi trong vòng 1 ngày