fixed -U option in rs-nogui. Removed debug output that would ruin the terminal interface

This commit is contained in:
csoler 2017-07-11 23:32:22 +02:00
parent 3e3ee1a34b
commit a5e0b1c336
5 changed files with 49 additions and 10 deletions

View file

@ -5,6 +5,8 @@
#include "util/rsdir.h"
#include "rsaccounts.h"
//#define DEBUG_RSLOGINHANDLER 1
bool RsLoginHandler::getSSLPassword( const RsPeerId& ssl_id,
bool enable_gpg_ask_passwd,
std::string& ssl_passwd )
@ -59,18 +61,21 @@ bool RsLoginHandler::getSSLPasswdFromGPGFile(const RsPeerId& ssl_id,std::string&
fclose(sslPassphraseFile);
#ifdef DEBUG_RSLOGINHANDLER
std::cerr << "opening sslPassphraseFile : "
<< getSSLPasswdFileName(ssl_id).c_str() << std::endl;
#endif
std::string plain;
if ( AuthGPG::getAuthGPG()->decryptTextFromFile( plain, getSSLPasswdFileName(ssl_id)) )
{
sslPassword = plain;
#ifdef DEBUG_RSLOGINHANDLER
if(sslPassword.length() > 0)
std::cerr << "Decrypting went ok !" << std::endl;
else
std::cerr << "Passphrase is empty!" << std::endl;
#endif
return sslPassword.length() > 0 ;
}