Skip to content

Commit

Permalink
fix: bash is not default SHELL for new user
Browse files Browse the repository at this point in the history
在未传入shell参数,并且从/etc/adduser.conf配置文件中未获取到DSHELL配置时,将"/bin/bash"作为新建用户的默认SHELL,以确保终端中能够正常展示当前用户名、机器名称、当前路径信息。

Log: 修复新建用户默认SHELL为"/bin/sh",导致的终端中未展示当前用户名、机器名称、当前路径信息的问题,
Issue: linuxdeepin/developer-center#5744
  • Loading branch information
hotime authored and dengbo11 committed Oct 24, 2023
1 parent f181f6c commit 7c65a36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions accounts1/users/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
cmdChAge = "chage"

defaultConfigShell = "/etc/adduser.conf"
defaultShell = "/bin/bash"
)

const (
Expand All @@ -38,6 +39,9 @@ func CreateUser(username, fullname, shell string) error {

if len(shell) == 0 {
shell, _ = getDefaultShell(defaultConfigShell)
if len(shell) == 0 {
shell = defaultShell
}
}

mockUserInfo := UserInfo{
Expand Down

0 comments on commit 7c65a36

Please sign in to comment.