mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
pam: try to avoid racey unlock states
This commit is contained in:
@@ -11,6 +11,7 @@ Scope {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool lockSecured: false
|
property bool lockSecured: false
|
||||||
|
property bool unlockInProgress: false
|
||||||
|
|
||||||
readonly property alias passwd: passwd
|
readonly property alias passwd: passwd
|
||||||
readonly property alias fprint: fprint
|
readonly property alias fprint: fprint
|
||||||
@@ -50,7 +51,11 @@ Scope {
|
|||||||
|
|
||||||
onCompleted: res => {
|
onCompleted: res => {
|
||||||
if (res === PamResult.Success) {
|
if (res === PamResult.Success) {
|
||||||
root.unlockRequested();
|
if (!root.unlockInProgress) {
|
||||||
|
root.unlockInProgress = true;
|
||||||
|
fprint.abort();
|
||||||
|
root.unlockRequested();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +97,11 @@ Scope {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (res === PamResult.Success) {
|
if (res === PamResult.Success) {
|
||||||
root.unlockRequested();
|
if (!root.unlockInProgress) {
|
||||||
|
root.unlockInProgress = true;
|
||||||
|
passwd.abort();
|
||||||
|
root.unlockRequested();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,8 +171,11 @@ Scope {
|
|||||||
root.state = "";
|
root.state = "";
|
||||||
root.fprintState = "";
|
root.fprintState = "";
|
||||||
root.lockMessage = "";
|
root.lockMessage = "";
|
||||||
|
root.unlockInProgress = false;
|
||||||
} else {
|
} else {
|
||||||
fprint.abort();
|
fprint.abort();
|
||||||
|
passwd.abort();
|
||||||
|
root.unlockInProgress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user