Repository navigation
feat: support expired password changes on lock and greeter - #108
Conversation
|
Sorry @yixinshark, your pull request is larger than the review limit of 150,000 diff characters |
a286ed1 to
897085b
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
897085b to
98dbefa
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
98dbefa to
5914b73
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
5914b73 to
be96ccf
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
be96ccf to
22faf0a
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
Add an opt-in lock password-expiry gate and a shared form for the current password, new password, confirmation and optional hint. Follow the greeter's LightDM/PAM password-change conversation and check the local password policy with pwcheck before submission. Return to ordinary authentication after one minute of inactivity. Clear draft credentials and invalidate pending results when suspending, deactivating the session, switching users or leaving authentication. Protect revealed passwords from PRIMARY export and discard hint undo history when resetting the form. Refresh Accounts expiry after successful biometric authentication so accounts with valid passwords can unlock without entering the change form. Discard unused password candidates before single-factor biometric completion and clear the cache on token-delivery errors. Preserve verified MFA credentials and fresh authentication after password-change cancellation. Cover the lock gate, greeter conversation and secure inputs with isolated regression tests. 增加默认关闭的锁屏密码过期拦截配置,复用旧密码、新密码、确认密码和可选 提示的同页表单。登录器遵循 LightDM/PAM 改密对话,提交前使用 pwcheck 检查本地密码策略。 空闲一分钟后返回普通认证页。待机、会话失活、切换用户或离开认证页时, 清空密码草稿并使未完成结果失效。阻止明文密码导出到 PRIMARY 选择区, 重置表单时清除密码提示的撤销历史。 生物认证成功后重新查询 Accounts 密码有效期,密码正常时直接解锁,避免 误入改密页。单因生物认证成功或令牌发送失败时清除未使用的密码提交缓存, 保留多因认证凭据及取消改密后的重新认证要求。补充锁屏拦截、登录器对话 和安全输入的隔离回归测试。 Log: support expired password changes on lock and greeter Change-Id: I182356829461e02adb570caa990a884fd46b639c
22faf0a to
f3a477f
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['考虑在 submitPasswords 中添加注释或断言,明确说明 m_checkAfterCurrentPassword 早返回保证不会跳过 startAccountCheck', 'respondToPrompts 的批次验证循环可提取为独立方法 validateBatch(),提高可读性'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['将 LockWorker 构造函数中的密码改密信号连接提取为独立的 initPasswordChangeConnections() 方法', '考虑将密码校验逻辑(非空、ASCII、提示不含密码)提取为共享工具函数'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['将 250ms、50ms 等定时器间隔提取为命名常量,如 constexpr int kExpiryCheckDelay = 250'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['lockpasswordchange.cpp startProcess: m_oldPassword.toUtf8() 和 m_newPassword.toUtf8() 产生的临时 QByteArray 在连接后释放但未填零,虽属 C++ 语言限制且整体防御已非常充分,可考虑使用 QByteArray 且在用后手动填零再释放'] 💡 改进建议代码示例// lockpasswordchange.cpp - startProcess 中临时 QByteArray 填零建议
void LockPasswordChange::startProcess()
{
// ...
connect(process, &QProcess::started, this, [this, process] {
if (m_process != process) {
return;
}
QByteArray oldPwd, newPwd;
if (!m_skipCurrentPassword) {
oldPwd = m_oldPassword.toUtf8();
}
newPwd = m_newPassword.toUtf8();
QByteArray responses;
if (!m_skipCurrentPassword) {
responses = oldPwd + '\n';
}
responses += newPwd + '\n' + newPwd + '\n';
process->write(responses);
responses.fill('\0');
oldPwd.fill('\0'); // 清除临时副本
newPwd.fill('\0'); // 清除临时副本
process->closeWriteChannel();
});
// ...
}本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: robertkill, yixinshark 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 |
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#108
Summary
stopUnlockWhenPasswordExpired(defaultfalse); greeter follows the LightDM/PAM conversation. Check new passwords with the local pwcheck policy before submission, and adapt build dependencies to the target repository's existing packaging.Validation
dde-lock,lightdm-deepin-greeter,dde-lock-testandlightdm-deepin-greeter-test, based onupstream/master(829ad62b).UT_LockPasswordSessiontests. The previous 50 greeter form/recovery tests remain valid for the unchanged greeter target.libdeepin_pw_checkplus existing Qt D-Bus startup watchers exposed by the upstream restart tests); the greeter run reports 3,720 bytes / 48 allocations (GLib/LightDM plus existingSFAWidgetanimations). Only the existing DTK preference and Qt gesture suppressions were used; no invalid memory accesses were reported.liblightdm-qt5-3. Live PAM/AD authentication and physical X11/Wayland UI acceptance remain to be verified on a test machine; the regression runs use mocked authentication and do not change real account passwords.