Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/lightdm-deepin-greeter/greeterworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,6 @@ void GreeterWorker::checkAccount(const QString &account)
const QString userPath = m_accountsInter->FindUserByName(account);
if (userPath.startsWith("/")) {
user_ptr = std::make_shared<NativeUser>(userPath);

// 对于没有设置密码的账户,直接认定为错误账户
if (!user_ptr->isPasswordValid()) {
qWarning() << userPath;
emit m_model->authFailedTipsMessage(tr("Wrong account"));
m_model->setAuthType(AT_None);
return;
}
Comment on lines -518 to -523
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving these all to the end of the function might lead to creating authentication even when the user is not in the nopasswdlogin group and his or her password is not set. I think you should judge if a user is in the nopasswdlogin group right here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, how do you think about my comment here?

} else if (!user_ptr) {
// 判断账户第一次登录时的有效性
std::string str = account.toStdString();
Expand Down Expand Up @@ -553,6 +545,13 @@ void GreeterWorker::checkAccount(const QString &account)
destroyAuthentication(m_account);
createAuthentication(user_ptr->name());
}
// 对于没有设置密码的账户,直接认定为错误账户
if (!user_ptr->isPasswordValid()) {
qWarning() << userPath;
emit m_model->authFailedTipsMessage(tr("Wrong account"));
m_model->setAuthType(AT_None);
return;
}
}

void GreeterWorker::checkDBusServer(bool isValid)
Expand Down