1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-08 23:02:05 -04:00

fix(lock): Restore system PAM fallback, faillock support, and auth feedback

- Re-add loginConfigWatcher so installs can still fall through to
  /etc/pam.d instead of the bundled PAM assets
- Add login-faillock bundled PAM asset at runtime. Use it as the bundled fallback when dankshell config is absent
- Fix invalid bare property writes (u2fPending, u2fState, unlockInProgress,
  state) in Pam.qml
- Improve lockscreen auth feedback
This commit is contained in:
purian23
2026-03-25 16:39:37 -04:00
parent faa5e7e02d
commit d5ceea8a56
6 changed files with 90 additions and 45 deletions

View File

@@ -34,14 +34,14 @@ Scope {
u2fPendingTimeout.running = false;
passwdActiveTimeout.running = false;
unlockRequestTimeout.running = false;
u2fPending = false;
u2fState = "";
unlockInProgress = false;
root.u2fPending = false;
root.u2fState = "";
root.unlockInProgress = false;
}
function recoverFromAuthStall(newState: string): void {
resetAuthFlows();
state = newState;
root.state = newState;
flashMsg();
stateReset.restart();
fprint.checkAvail();
@@ -49,16 +49,16 @@ Scope {
}
function completeUnlock(): void {
if (!unlockInProgress) {
unlockInProgress = true;
if (!root.unlockInProgress) {
root.unlockInProgress = true;
passwd.abort();
fprint.abort();
u2f.abort();
errorRetry.running = false;
u2fErrorRetry.running = false;
u2fPendingTimeout.running = false;
u2fPending = false;
u2fState = "";
root.u2fPending = false;
root.u2fState = "";
unlockRequestTimeout.restart();
unlockRequested();
}
@@ -73,13 +73,13 @@ Scope {
}
function cancelU2fPending(): void {
if (!u2fPending)
if (!root.u2fPending)
return;
u2f.abort();
u2fErrorRetry.running = false;
u2fPendingTimeout.running = false;
u2fPending = false;
u2fState = "";
root.u2fPending = false;
root.u2fState = "";
fprint.checkAvail();
}
@@ -90,6 +90,13 @@ Scope {
printErrors: false
}
FileView {
id: loginConfigWatcher
path: "/etc/pam.d/login"
printErrors: false
}
FileView {
id: u2fConfigWatcher
@@ -97,17 +104,22 @@ Scope {
printErrors: false
}
readonly property string bundledPasswdConfig: SettingsData.lockFaillockSupported ? "login-faillock" : "login"
PamContext {
id: passwd
config: dankshellConfigWatcher.loaded ? "dankshell" : "login"
configDirectory: dankshellConfigWatcher.loaded ? "/etc/pam.d" : Quickshell.shellDir + "/assets/pam"
config: dankshellConfigWatcher.loaded ? "dankshell" : root.bundledPasswdConfig
configDirectory: (dankshellConfigWatcher.loaded || loginConfigWatcher.loaded) ? "/etc/pam.d" : Quickshell.shellDir + "/assets/pam"
onMessageChanged: {
if (message.startsWith("The account is locked"))
if (message.startsWith("The account is locked")) {
root.lockMessage = message;
else if (root.lockMessage && message.endsWith(" left to unlock)"))
} else if (root.lockMessage && message.endsWith(" left to unlock)")) {
root.lockMessage += "\n" + message;
} else if (root.lockMessage && message && message.length > 0) {
root.lockMessage = "";
}
}
onResponseRequiredChanged: {