dde-session-shell/0002-fix-dde-lock-prompt-message.patch

51 lines
2.0 KiB
Diff
Raw Normal View History

2024-04-09 14:03:22 +08:00
diff -Naur a/src/libdde-auth/deepinauthframework.cpp b/src/libdde-auth/deepinauthframework.cpp
--- a/src/libdde-auth/deepinauthframework.cpp 2023-10-09 14:52:49.000000000 +0800
+++ b/src/libdde-auth/deepinauthframework.cpp 2024-03-04 15:45:26.110492602 +0800
@@ -129,13 +129,15 @@
} else {
qDebug() << "PAM start...";
}
-
+
+ m_message = "";
int rc = pam_authenticate(m_pamHandle, 0);
if (rc != PAM_SUCCESS) {
qWarning() << "PAM authenticate failed:" << pam_strerror(m_pamHandle, rc) << rc;
if (m_message.isEmpty()) m_message = pam_strerror(m_pamHandle, rc);
} else {
qDebug() << "PAM authenticate finished.";
+ m_message = "";
}
int re = pam_end(m_pamHandle, rc);
@@ -185,8 +187,9 @@
qWarning() << "PAM_BUF_ERR";
return PAM_BUF_ERR;
}
- const QString message = QString::fromLocal8Bit(PAM_MSG_MEMBER(msg, idx, msg));
+ //const QString message = QString::fromLocal8Bit(PAM_MSG_MEMBER(msg, idx, msg));
for (idx = 0; idx < num_msg; ++idx) {
+ const QString message = QString::fromLocal8Bit(PAM_MSG_MEMBER(msg, idx, msg));
switch (PAM_MSG_MEMBER(msg, idx, msg_style)) {
case PAM_PROMPT_ECHO_ON:
case PAM_PROMPT_ECHO_OFF: {
@@ -219,15 +222,15 @@
}
case PAM_ERROR_MSG: {
qDebug() << "pam auth error: " << message;
- app_ptr->m_message = message;
+ //app_ptr->m_message = message;
app_ptr->UpdateAuthState(AS_Failure, message);
aresp[idx].resp_retcode = PAM_SUCCESS;
break;
}
case PAM_TEXT_INFO: {
qDebug() << "pam auth info: " << message;
- app_ptr->m_message = message;
- app_ptr->UpdateAuthState(AS_Prompt, message);
+ //app_ptr->m_message = message;
+ app_ptr->UpdateAuthState(AS_Failure, message);
aresp[idx].resp_retcode = PAM_SUCCESS;
break;
}