refactor(accounts1): remove guest user functionality#1047
Merged
ComixHe merged 1 commit intolinuxdeepin:masterfrom Mar 5, 2026
Merged
refactor(accounts1): remove guest user functionality#1047ComixHe merged 1 commit intolinuxdeepin:masterfrom
ComixHe merged 1 commit intolinuxdeepin:masterfrom
Conversation
Remove guest user feature to address security vulnerability identified in security report. The CreateGuestUser() function had a race condition when creating home directories in /tmp, which could allow other users to pre-create directories under their control. Since guest user functionality is no longer needed, it has been completely removed. Pms: BUG-349985 Signed-off-by: ComixHe <heyuming@deepin.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the deprecated guest user feature from the accounts1 service, including D-Bus methods, configuration handling, and backing implementation, while updating copyright years. Sequence diagram for the removed CreateGuestAccount flowsequenceDiagram
actor Client
participant Manager as Manager(CreateGuestAccount)
participant Users as usersPackage
Client->>Manager: CreateGuestAccount(sender)
Manager->>Manager: checkAuth(sender)
alt authorized
Manager->>Users: CreateGuestUser()
Users-->>Manager: name
Manager->>Users: GetUserInfoByName(name)
Users-->>Manager: info(Uid)
Manager-->>Client: userDBusPathPrefix + info.Uid
else not authorized
Manager-->>Client: dbus.Error (authorization failed)
end
%% Entire CreateGuestAccount interaction has been removed in the refactor
Class diagram for refactored Manager without guest user supportclassDiagram
class ManagerBefore {
<<struct>>
%% fields
dbusutil.Service service
map~string, *User~ usersMap
[]string UserList
sync.RWMutex UserListMu
string GuestIcon
bool AllowGuest
[]string GroupList
%% methods
AllowGuestAccount(sender dbus.Sender, allow bool) *dbus.Error
CreateGuestAccount(sender dbus.Sender) (string, *dbus.Error)
isGuestUserEnabled() bool
setPropAllowGuest(value bool) bool
emitPropChangedAllowGuest(value bool) error
}
class ManagerAfter {
<<struct>>
%% fields
dbusutil.Service service
map~string, *User~ usersMap
[]string UserList
sync.RWMutex UserListMu
[]string GroupList
%% methods
%% guest-related methods removed
}
ManagerBefore <|-- ManagerAfter
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码 diff 的主要目的是移除系统中的访客账户(Guest Account)功能。通过删除与访客账户相关的属性、方法、DBUS 接口以及辅助工具函数,简化了账户管理逻辑。 以下是对代码变更的详细审查意见,分为语法逻辑、代码质量、代码性能和代码安全四个方面: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段代码变更质量很高,成功移除了一个不再需要的功能模块,并随之清理了相关的依赖和配置,有助于提升系统的简洁性和安全性。 改进建议:
|
fly602
approved these changes
Mar 5, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ComixHe, 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove guest user feature to address security vulnerability identified in security report. The CreateGuestUser() function had a race condition when creating home directories in /tmp, which could allow other users to pre-create directories under their control. Since guest user functionality is no longer needed, it has been completely removed.
Pms: BUG-349985
Summary by Sourcery
Remove deprecated guest user account support from the accounts1 manager and its D-Bus interface.
Enhancements: