feat: support automatic login for user sessions - #106
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's GuideAdds an automatic user login feature by introducing a dedicated ddm‑autologin PAM service, new autologin configuration options, and refactoring the display login flow to reuse a shared session-start routine that supports both normal and passwordless login paths. Sequence diagram for automatic login vs showing greetersequenceDiagram
actor Greeter
participant Display
participant Auth
participant Pam_ddm_autologin
Greeter->>Display: connected(socket)
Display->>Display: check auths for active sessions
alt [no active user] and [Autologin.User set] and [Autologin.Timeout == 0]
Display->>Display: startAutologin()
Display->>Auth: new Auth(this, user)
Display->>Auth: set pamService = ddm-autologin
Auth->>Pam_ddm_autologin: authenticate(QByteArray())
Pam_ddm_autologin-->>Auth: success/failure
alt [authentication success]
Display->>Display: startUserSession(auth, session)
Display-->>Greeter: (no message, greeter stays hidden)
else [authentication failed or session start failed]
Display-->>Greeter: ShowGreeter
end
else other cases
Display-->>Greeter: ShowGreeter
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1b168b5 to
3e96f6b
Compare
PR 审查结果对 treeland #1305 + ddm #106 的联合审查中,ddm 部分的审查结论如下。整体方案连贯,无阻断性问题。 交互流程验证三条路径均自洽:
设计合理的部分
需要处理的问题
安全设计说明(澄清)
总结无阻断性问题,建议合入前处理以下可操作项:
|
8aeb396 to
245f433
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds configurable automatic login and passwordless login support to ddm’s daemon-side session flow. It introduces a dedicated ddm-autologin PAM service, a nopasswdlogin group bypass in PAM, and refactors the display login path to reuse shared session-start logic.
Changes:
- Add
Autologinconfiguration (user + optional session) and trigger autologin on first greeter connection after boot. - Refactor session startup into
Display::startUserSession(Auth*, Session)to reuse logic between normal login and autologin. - Install new PAM service files (
ddm-autologin) and definenopasswdlogingroup via sysusers on supported distributions.
中文说明:
本 PR 为 ddm 增加可配置的自动登录与免密登录能力:新增独立的 ddm-autologin PAM 服务与 nopasswdlogin 组免密规则,并重构 Display 登录流程以复用统一的会话启动逻辑。
变更点:
- 新增
Autologin配置(用户 + 可选会话),并在 greeter 首次连接时尝试自动登录。 - 提取
Display::startUserSession(Auth*, Session),复用普通登录与自动登录的会话启动逻辑。 - 安装
ddm-autologinPAM 配置,并通过 sysusers 定义nopasswdlogin用户组。
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/daemon/Display.h |
Add session-start/autologin helpers and first-connect tracking flag. |
src/daemon/Display.cpp |
Implement autologin trigger + shared session startup refactor. |
src/daemon/Auth.h |
Add configurable PAM service name per Auth instance. |
src/daemon/Auth.cpp |
Use pamService when calling pam_start(). |
src/common/Messages.h |
Add new daemon→greeter message ShowGreeter. |
src/common/Configuration.h |
Add Autologin config section entries. |
services/debian.ddm.pam |
Enable nopasswdlogin group passwordless auth on Debian. |
services/debian.ddm-sysuser.conf.in |
Add nopasswdlogin group for Debian sysusers. |
services/debian.ddm-autologin.pam |
Add Debian-specific autologin PAM service definition. |
services/ddm.pam |
Add nopasswdlogin group passwordless auth on non-Debian. |
services/ddm-sysuser.conf.in |
Add nopasswdlogin group for non-Debian sysusers. |
services/ddm-autologin.pam |
Add non-Debian autologin PAM service definition. |
services/CMakeLists.txt |
Install ddm-autologin PAM files on Debian and non-Debian. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add autologin support with dedicated ddm-autologin PAM service and nopasswdlogin group for passwordless login. 新增自动登录功能:提供独立的ddm-autologin PAM服务,并通过 nopasswdlogin用户组支持免密登录。重构Display登录流程,提取 startUserSession()复用会话启动逻辑,登录时根据配置决定直接 自动登录或显示登录界面。 PMS: BUG-294419 Log: 支持用户自动登录 Influence: 配置Autologin后可跳过登录界面直接进入桌面;nopasswdlogin组成员可免密登录。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glyvut, zccrs 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 |
Add autologin support with dedicated ddm-autologin PAM service and nopasswdlogin group for passwordless login.
新增自动登录功能:提供独立的ddm-autologin PAM服务,并通过
nopasswdlogin用户组支持免密登录。重构Display登录流程,提取
startUserSession()复用会话启动逻辑,登录时根据配置决定直接
自动登录或显示登录界面。
Log: 支持用户自动登录
Influence: 配置Autologin后可跳过登录界面直接进入桌面;nopasswdlogin组成员可免密登录。
Summary by Sourcery
Enable configurable passwordless automatic login while preserving the existing greeter-based login flow.
New Features:
Enhancements:
Build: