mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-29 11:01:22 -04:00
Fixed database keying bug, left db closed causing meta modification fail.
- needed to keep ssl pword a little while longer after rs init Added more sturdy logic to prevent segv on failed msg/grp meta modification Added, Data base does not key database if key string is empty git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6448 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5e319b1261
commit
6b0594dfe1
4 changed files with 36 additions and 22 deletions
|
@ -47,18 +47,26 @@ RetroDb::RetroDb(const std::string &dbPath, int flags, const std::string& key) :
|
|||
std::cerr << "Can't open database, Error code: " << sqlite3_errmsg(mDb)
|
||||
<< std::endl;
|
||||
sqlite3_close(mDb);
|
||||
mDb = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCRYPTED_DB
|
||||
rc = sqlite3_key(mDb, mKey.c_str(), mKey.size());
|
||||
if(!mKey.empty())
|
||||
{
|
||||
rc = sqlite3_key(mDb, mKey.c_str(), mKey.size());
|
||||
|
||||
if(rc){
|
||||
std::cerr << "Can't key database: " << sqlite3_errmsg(mDb)
|
||||
<< std::endl;
|
||||
|
||||
sqlite3_close(mDb);
|
||||
mDb = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(rc){
|
||||
std::cerr << "Can't key database: " << sqlite3_errmsg(mDb)
|
||||
<< std::endl;
|
||||
|
||||
sqlite3_close(mDb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue