mirror of https://github.com/macssh/macssh.git
check that terminal is still opened before asking for password
This commit is contained in:
parent
f0145ce772
commit
db2e4b8916
|
@ -847,6 +847,9 @@ char *getpass( const char *prompt )
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
LockDialog();
|
LockDialog();
|
||||||
|
/* may need to reload the window... */
|
||||||
|
wind = ssh2_window();
|
||||||
|
if ( wind ) {
|
||||||
context->_pindex = index;
|
context->_pindex = index;
|
||||||
if ( gApplicationPrefs->cachePassphrase && !wind->sshdata.password[0]
|
if ( gApplicationPrefs->cachePassphrase && !wind->sshdata.password[0]
|
||||||
&& getnextcachedpassphrase(cprompt, password, &context->_pindex) ) {
|
&& getnextcachedpassphrase(cprompt, password, &context->_pindex) ) {
|
||||||
|
@ -871,6 +874,10 @@ char *getpass( const char *prompt )
|
||||||
addcachedpassphrase(context, cprompt, password);
|
addcachedpassphrase(context, cprompt, password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// terminal has been closed
|
||||||
|
valid = 0;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* encrypted private key */
|
/* encrypted private key */
|
||||||
|
@ -883,6 +890,7 @@ char *getpass( const char *prompt )
|
||||||
return context->_kpassword;
|
return context->_kpassword;
|
||||||
}
|
}
|
||||||
LockDialog();
|
LockDialog();
|
||||||
|
if (wind == ssh2_window()) {
|
||||||
context->_kindex = index;
|
context->_kindex = index;
|
||||||
if ( gApplicationPrefs->cachePassphrase
|
if ( gApplicationPrefs->cachePassphrase
|
||||||
&& getnextcachedpassphrase(prompt, context->_kpassword, &context->_kindex) ) {
|
&& getnextcachedpassphrase(prompt, context->_kpassword, &context->_kindex) ) {
|
||||||
|
@ -901,6 +909,10 @@ char *getpass( const char *prompt )
|
||||||
addcachedpassphrase(context, prompt, password);
|
addcachedpassphrase(context, prompt, password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// terminal has been closed
|
||||||
|
valid = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UnlockDialog();
|
UnlockDialog();
|
||||||
return (valid) ? password : NULL;
|
return (valid) ? password : NULL;
|
||||||
|
|
Loading…
Reference in New Issue