fix: skip deepin-keyring-whitebox for xrdp sessions#195
fix: skip deepin-keyring-whitebox for xrdp sessions#195fly602 wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConditionally skip starting the deepin keyring whitebox client during XRDP sessions by guarding its startup in the Xsession script with an XRDP-specific environment check, while keeping behavior unchanged for normal local logins. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
8d55bf8 to
9ef372e
Compare
The original script directly started both gnome-keyring-daemon and deepin-keyring-whitebox during X session initialization, which caused issues with xrdp remote login sessions. The deepin-keyring-whitebox service was blocking xrdp connections. This change replaces the direct script execution with a systemd user service (dde-keyring.service) that includes conditional logic to skip deepin-keyring-whitebox startup when XRDP_SESSION environment variable is detected. The service properly handles both keyring components with appropriate dependencies and timeouts. Key changes: 1. Removed direct keyring startup from Xsession script 2. Added new systemd user service for keyring management 3. Added XRDP_SESSION environment check to skip whitebox in remote sessions 4. Maintained gnome-keyring functionality for all session types 5. Set proper service dependencies and timeout handling Log: Fixed xrdp remote login issue caused by deepin-keyring-whitebox service Influence: 1. Test local desktop login to ensure keyring services start normally 2. Test xrdp remote login to verify whitebox service is properly skipped 3. Verify gnome-keyring-daemon starts in both local and remote sessions 4. Check that password management and SSH key functionality work correctly 5. Test session startup time and service dependencies fix: 解决白盒密钥服务阻塞xrdp远程登录的问题 原脚本在X会话初始化时直接启动gnome-keyring-daemon和deepin-keyring- whitebox,这导致xrdp远程登录会话出现问题。deepin-keyring-whitebox服务会 阻塞xrdp连接。 此次更改将直接脚本执行替换为systemd用户服务(dde-keyring.service),该服务 包含条件逻辑,在检测到XRDP_SESSION环境变量时跳过deepin-keyring-whitebox 启动。该服务通过适当的依赖关系和超时设置来正确处理两个密钥环组件。 PMS: BUG-320847 主要变更: 1. 从Xsession脚本中移除直接启动密钥环的代码 2. 新增systemd用户服务用于密钥环管理 3. 添加XRDP_SESSION环境检查以在远程会话中跳过白盒服务 4. 为所有会话类型保持gnome-keyring功能正常 5. 设置正确的服务依赖关系和超时处理 Log: 修复deepin-keyring-whitebox服务导致的xrdp远程登录问题 Influence: 1. 测试本地桌面登录,确保密钥环服务正常启动 2. 测试xrdp远程登录,验证白盒服务被正确跳过 3. 验证gnome-keyring-daemon在本地和远程会话中都能启动 4. 检查密码管理和SSH密钥功能正常工作 5. 测试会话启动时间和服务依赖关系
deepin pr auto review这段代码主要涉及从传统的 Xsession 启动脚本迁移到 systemd 用户服务管理的过程。这是一个很好的现代化改进,有助于更好地管理桌面会话的生命周期。 以下是对该 diff 的详细审查和改进建议: 1. 语法与逻辑审查
2. 代码质量与改进意见问题点: 在 改进建议: 修改后的方案:
#!/bin/sh
# /usr/libexec/dde-keyring-wrapper
if [ -x /usr/bin/gnome-keyring-daemon ]; then
echo "start gnome-keyring-daemon with components secrets,pkcs11,ssh"
/usr/bin/gnome-keyring-daemon --start --components=secrets,pkcs11,ssh
fi
if [ -x /usr/bin/deepin-keyring-whitebox ] && [ -z "$XRDP_SESSION" ]; then
echo "start deepin-keyring-whitebox client"
# 注意:这里不需要 &,因为 systemd 的 Type=oneshot 配合 RemainAfterExit=yes 会处理进程状态
# 或者如果该程序必须作为守护进程运行,建议将其拆分为另一个单独的 service
/usr/bin/deepin-keyring-whitebox --opt-client=waitfifonotify &
fi
[Unit]
Description=Deepin Keyring Service (GNOME Keyring + Whitebox Client)
Documentation=man:gnome-keyring-daemon(1)
After=dbus.socket
PartOf=graphical-session.target
[Service]
Type=oneshot
RemainAfterExit=yes
# 直接调用封装脚本,更清晰且易于调试
ExecStart=/usr/libexec/dde-keyring-wrapper
Restart=no
TimeoutStartSec=1803. 代码性能
4. 代码安全
总结这个 diff 的主要方向(从 Xsession 迁移到 systemd)是正确的。
|
Modify the startup script to conditionally skip launching deepin- keyring-whitebox client when XRDP remote desktop session is detected. Added a check for XRDP_SESSION environment variable before starting the whitebox keyring service.
The change prevents potential conflicts and issues that may arise when trying to use the whitebox keyring system in remote desktop environments where it may not be properly supported or could cause authentication problems.
Influence:
fix: xrdp远程登录时跳过白盒密钥环
修改启动脚本,在检测到XRDP远程桌面会话时有条件地跳过启动deepin-keyring-
whitebox客户端。在启动白盒密钥环服务前添加了对XRDP_SESSION环境变量的
检查。
此更改防止在远程桌面环境中使用白盒密钥环系统时可能出现的潜在冲突和问题,
因为在这些环境中可能无法正确支持或可能导致认证问题。
PMS: BUG-320847
Influence:
Summary by Sourcery
Skip starting the deepin keyring whitebox client when an XRDP remote desktop session is detected to avoid authentication issues while preserving normal behavior for local sessions.
Bug Fixes:
Tests: