mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 21:02:06 -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:
@@ -31,14 +31,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();
|
||||
@@ -46,16 +46,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();
|
||||
}
|
||||
@@ -70,13 +70,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();
|
||||
}
|
||||
|
||||
@@ -87,6 +87,13 @@ Scope {
|
||||
printErrors: false
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: loginConfigWatcher
|
||||
|
||||
path: "/etc/pam.d/login"
|
||||
printErrors: false
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: u2fConfigWatcher
|
||||
|
||||
@@ -94,17 +101,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: {
|
||||
|
||||
Reference in New Issue
Block a user