lock semaphore before getting cached passphrase

This commit is contained in:
chombier 2001-04-23 09:42:08 +00:00
parent 3c21bf8b10
commit a62abd7587
1 changed files with 7 additions and 2 deletions

View File

@ -548,19 +548,24 @@ Boolean SSH2PasswordDialog(const char *prompt, StringPtr password)
SetControlValue(cntlHandle, addKey = true);
} else {
HideDialogItem(dlog, 6);
cntlHandle = NULL;
addKey = false;
}
SetDialogDefaultItem(dlog, 1);
SetDialogCancelItem(dlog, 2);
SetDialogTracksCursor(dlog, 1);
ShowWindow(dlog);
SetWRefCon(dlog, (long)password); // Stash the buffer's address
DrawDialog(dlog);
do {
movableModalDialog(internalBufferFilterUPP, &item);
if (item == 6) {
if (item == 6 && cntlHandle) {
SetControlValue(cntlHandle, !GetControlValue(cntlHandle));
}
} while (item != 1 && item != 2); // Until the OK button is hit
addKey = GetControlValue(cntlHandle);
if ( cntlHandle ) {
addKey = GetControlValue(cntlHandle);
}
DisposeDialog(dlog);
}
DisposeRoutineDescriptor(internalBufferFilterUPP);