block the notify callback of authgpg when the main windows is launched

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2698 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-04-08 19:08:41 +00:00
parent ffdd38ddd5
commit 9f8a032d93
3 changed files with 19 additions and 22 deletions

View file

@ -88,7 +88,7 @@ gpg_error_t pgp_pwd_callback(void *hook, const char *uid_hint, const char *passp
#endif
text = gpg_password_static;
} else {
if(prev_was_bad) {
if(prev_was_bad || !AuthGPG::getAuthGPG()->getAutorisePasswordCallbackNotify()) {
#ifdef GPG_DEBUG
fprintf(stderr, "pgp_pwd_callback() allow only one try to be consistent with gpg agent.\n");
#endif
@ -124,7 +124,7 @@ static char *PgpPassword = NULL;
AuthGPG::AuthGPG()
:gpgmeInit(false),gpgmeKeySelected(false),p3Config(CONFIG_TYPE_AUTHGPG)
:gpgmeInit(false),gpgmeKeySelected(false),autorisePasswordCallbackNotify(true),p3Config(CONFIG_TYPE_AUTHGPG)
{
{
RsStackReadWriteMutex stack(pgpMtx, RsReadWriteMutex::WRITE_LOCK); /******* LOCKED ******/
@ -274,7 +274,7 @@ int AuthGPG::GPGInit(std::string ownId)
std::cerr << "AuthGPG::GPGInit() called with own gpg id : " << ownId << std::endl;
{
RsStackReadWriteMutex stack(pgpMtx, RsReadWriteMutex::WRITE_LOCK); /******* LOCKED ******/
RsStackReadWriteMutex stack(pgpMtx, RsReadWriteMutex::WRITE_LOCK); /******* LOCKED ******/
is_set_gpg_password_static= false;
if (!gpgmeInit) {
return 0;
@ -2157,3 +2157,12 @@ bool AuthGPG::loadList(std::list<RsItem*> load)
}
return true;
}
void AuthGPG::setAutorisePasswordCallbackNotify(bool autorise) {
autorisePasswordCallbackNotify = autorise;
return;
}
bool AuthGPG::getAutorisePasswordCallbackNotify() {
return autorisePasswordCallbackNotify;
}