Skip to content

Commit

Permalink
auth: assert username (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaideiaDilemma authored Dec 23, 2024
1 parent 5361dc4 commit bf37645
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auth/Pam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ bool CPam::auth() {
const pam_conv localConv = {conv, (void*)&m_sConversationState};
pam_handle_t* handle = NULL;
auto uidPassword = getpwuid(getuid());
RASSERT(uidPassword && uidPassword->pw_name, "Failed to get username (getpwuid)");

int ret = pam_start(m_sPamModule.c_str(), uidPassword->pw_name, &localConv, &handle);
int ret = pam_start(m_sPamModule.c_str(), uidPassword->pw_name, &localConv, &handle);

if (ret != PAM_SUCCESS) {
m_sConversationState.failText = "pam_start failed";
Expand Down

0 comments on commit bf37645

Please sign in to comment.