1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

Update PAM defaults

This commit is contained in:
purian23
2026-03-10 01:01:21 -04:00
parent 713b36662c
commit 44e6701796
3 changed files with 19 additions and 22 deletions

View File

@@ -1631,8 +1631,9 @@ func checkGreeterStatus() error {
} }
} else { } else {
if fprintAvailableForCurrentUser { if fprintAvailableForCurrentUser {
fmt.Printf(" Fingerprint auth is active via included %s while DMS fingerprint toggle is off.\n", includedFprintFile) fmt.Printf(" Fingerprint auth is active via included %s while DMS fingerprint toggle is off.\n", includedFprintFile)
fmt.Printf(" %s\n", systemPamManagerRemediationHint()) fmt.Println(" Password login will work but may be delayed while the fingerprint module runs first.")
fmt.Printf(" To eliminate the delay, %s\n", systemPamManagerRemediationHint())
} else { } else {
fmt.Printf(" pam_fprintd is present via included %s, but no enrolled fingerprints were detected for user %s.\n", includedFprintFile, currentUser.Username) fmt.Printf(" pam_fprintd is present via included %s, but no enrolled fingerprints were detected for user %s.\n", includedFprintFile, currentUser.Username)
fmt.Println(" Password auth remains the effective login path.") fmt.Println(" Password auth remains the effective login path.")

View File

@@ -1506,8 +1506,9 @@ func syncGreeterPamConfig(homeDir string, logFunc func(string), sudoPassword str
} }
} else { } else {
if fprintAvailableForCurrentUser { if fprintAvailableForCurrentUser {
logFunc(" Fingerprint auth is active via included " + includedFprintFile + " while DMS fingerprint toggle is off.") logFunc(" Fingerprint auth is active via included " + includedFprintFile + " while DMS fingerprint toggle is off.")
logFunc(" " + pamManagerHintForCurrentDistro()) logFunc(" Password login will work but may be delayed while the fingerprint module runs first.")
logFunc(" To eliminate the delay, " + pamManagerHintForCurrentDistro())
} else { } else {
logFunc(" pam_fprintd is present via included " + includedFprintFile + ", but no enrolled fingerprints were detected for the current user.") logFunc(" pam_fprintd is present via included " + includedFprintFile + ", but no enrolled fingerprints were detected for the current user.")
logFunc(" Password auth remains the effective login path.") logFunc(" Password auth remains the effective login path.")

View File

@@ -35,8 +35,8 @@ Item {
property bool pendingPasswordResponse: false property bool pendingPasswordResponse: false
property bool passwordSubmitRequested: false property bool passwordSubmitRequested: false
property bool cancelingExternalAuthForPassword: false property bool cancelingExternalAuthForPassword: false
property int defaultAuthTimeoutMs: 12000 property int defaultAuthTimeoutMs: 10000
property int externalAuthTimeoutMs: 45000 property int externalAuthTimeoutMs: 36000
property int memoryFlushDelayMs: 120 property int memoryFlushDelayMs: 120
property string pendingLaunchCommand: "" property string pendingLaunchCommand: ""
property var pendingLaunchEnv: [] property var pendingLaunchEnv: []
@@ -54,9 +54,8 @@ Item {
property int maxPasswordSessionTransitionRetries: 2 property int maxPasswordSessionTransitionRetries: 2
readonly property bool greeterPamHasFprint: pamModuleEnabled(greetdPamText, "pam_fprintd") || (greetdPamText.includes("system-auth") && pamModuleEnabled(systemAuthPamText, "pam_fprintd")) || (greetdPamText.includes("common-auth") && pamModuleEnabled(commonAuthPamText, "pam_fprintd")) || (greetdPamText.includes("password-auth") && pamModuleEnabled(passwordAuthPamText, "pam_fprintd")) readonly property bool greeterPamHasFprint: pamModuleEnabled(greetdPamText, "pam_fprintd") || (greetdPamText.includes("system-auth") && pamModuleEnabled(systemAuthPamText, "pam_fprintd")) || (greetdPamText.includes("common-auth") && pamModuleEnabled(commonAuthPamText, "pam_fprintd")) || (greetdPamText.includes("password-auth") && pamModuleEnabled(passwordAuthPamText, "pam_fprintd"))
readonly property bool greeterPamHasU2f: pamModuleEnabled(greetdPamText, "pam_u2f") || (greetdPamText.includes("system-auth") && pamModuleEnabled(systemAuthPamText, "pam_u2f")) || (greetdPamText.includes("common-auth") && pamModuleEnabled(commonAuthPamText, "pam_u2f")) || (greetdPamText.includes("password-auth") && pamModuleEnabled(passwordAuthPamText, "pam_u2f")) readonly property bool greeterPamHasU2f: pamModuleEnabled(greetdPamText, "pam_u2f") || (greetdPamText.includes("system-auth") && pamModuleEnabled(systemAuthPamText, "pam_u2f")) || (greetdPamText.includes("common-auth") && pamModuleEnabled(commonAuthPamText, "pam_u2f")) || (greetdPamText.includes("password-auth") && pamModuleEnabled(passwordAuthPamText, "pam_u2f"))
readonly property bool greeterExternalAuthCapable: greeterPamHasFprint || greeterPamHasU2f readonly property bool greeterExternalAuthAvailable: (greeterPamHasFprint && GreetdSettings.greeterEnableFprint) || (greeterPamHasU2f && GreetdSettings.greeterEnableU2f)
readonly property bool greeterExternalAuthEnabledByToggle: (greeterPamHasFprint && GreetdSettings.greeterEnableFprint) || (greeterPamHasU2f && GreetdSettings.greeterEnableU2f) readonly property bool greeterPamHasExternalAuth: greeterPamHasFprint || greeterPamHasU2f
readonly property bool greeterExternalAuthAvailable: greeterExternalAuthCapable
function initWeatherService() { function initWeatherService() {
if (weatherInitialized) if (weatherInitialized)
@@ -412,10 +411,7 @@ Item {
if (Greetd.state !== GreetdState.Inactive) { if (Greetd.state !== GreetdState.Inactive) {
if (pendingPasswordResponse && hasPasswordBuffer) if (pendingPasswordResponse && hasPasswordBuffer)
submitBufferedPassword(); submitBufferedPassword();
else if (awaitingExternalAuth && hasPasswordBuffer) { else if (hasPasswordBuffer)
passwordSubmitRequested = true;
requestPasswordSessionTransition();
} else if (hasPasswordBuffer)
passwordSubmitRequested = true; passwordSubmitRequested = true;
return; return;
} }
@@ -424,11 +420,11 @@ Item {
passwordSubmitRequested = true; passwordSubmitRequested = true;
return; return;
} }
if (!hasPasswordBuffer && !root.greeterExternalAuthEnabledByToggle) if (!hasPasswordBuffer && !root.greeterExternalAuthAvailable)
return; return;
pendingPasswordResponse = false; pendingPasswordResponse = false;
passwordSubmitRequested = hasPasswordBuffer; passwordSubmitRequested = hasPasswordBuffer;
awaitingExternalAuth = !hasPasswordBuffer && root.greeterExternalAuthEnabledByToggle; awaitingExternalAuth = !hasPasswordBuffer && root.greeterExternalAuthAvailable;
authTimeout.interval = awaitingExternalAuth ? externalAuthTimeoutMs : defaultAuthTimeoutMs; authTimeout.interval = awaitingExternalAuth ? externalAuthTimeoutMs : defaultAuthTimeoutMs;
authTimeout.restart(); authTimeout.restart();
Greetd.createSession(GreeterState.username); Greetd.createSession(GreeterState.username);
@@ -437,7 +433,7 @@ Item {
function maybeAutoStartExternalAuth() { function maybeAutoStartExternalAuth() {
if (!GreeterState.showPasswordInput || !GreeterState.username) if (!GreeterState.showPasswordInput || !GreeterState.username)
return; return;
if (!root.greeterExternalAuthEnabledByToggle) if (!root.greeterExternalAuthAvailable)
return; return;
if (GreeterState.unlocking || Greetd.state !== GreetdState.Inactive) if (GreeterState.unlocking || Greetd.state !== GreetdState.Inactive)
return; return;
@@ -958,7 +954,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
iconName: root.greeterPamHasFprint ? "fingerprint" : "key" iconName: root.greeterPamHasFprint ? "fingerprint" : "key"
buttonSize: 32 buttonSize: 32
visible: GreeterState.showPasswordInput && root.greeterExternalAuthEnabledByToggle && GreeterState.passwordBuffer.length === 0 && (Greetd.state === GreetdState.Inactive || awaitingExternalAuth || pendingPasswordResponse) && !GreeterState.unlocking visible: GreeterState.showPasswordInput && root.greeterExternalAuthAvailable && GreeterState.passwordBuffer.length === 0 && (Greetd.state === GreetdState.Inactive || awaitingExternalAuth || pendingPasswordResponse) && !GreeterState.unlocking
enabled: visible enabled: visible
onClicked: root.startAuthSession() onClicked: root.startAuthSession()
} }
@@ -1594,13 +1590,12 @@ Item {
return; return;
} }
pendingPasswordResponse = false; pendingPasswordResponse = false;
if (passwordSubmitRequested && GreeterState.passwordBuffer && GreeterState.passwordBuffer.length > 0 && awaitingExternalAuth && !cancelingExternalAuthForPassword) {
requestPasswordSessionTransition();
return;
}
if (!passwordSubmitRequested) if (!passwordSubmitRequested)
awaitingExternalAuth = root.isExternalAuthPrompt(message, responseRequired); awaitingExternalAuth = root.isExternalAuthPrompt(message, responseRequired);
authTimeout.interval = awaitingExternalAuth ? externalAuthTimeoutMs : defaultAuthTimeoutMs; if (awaitingExternalAuth || (passwordSubmitRequested && root.isExternalAuthPrompt(message, responseRequired)))
authTimeout.interval = externalAuthTimeoutMs;
else
authTimeout.interval = defaultAuthTimeoutMs;
authTimeout.restart(); authTimeout.restart();
Greetd.respond(""); Greetd.respond("");
} }