mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-16 01:54:52 -04:00
Added multiple security tests to pgp keyring against disk full and exceeded quota.
- copy files to tmp before appending new keys, then rename back to original. - always check for disk full before syncing keyrings - use tmp file to sync keyring - new RsDirUtil::fileExists() method - check system for disk space in pgp directory - added RsPGPDirectory() method to RsInit git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6541 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d6104c0aa7
commit
b84930b157
7 changed files with 94 additions and 10 deletions
|
@ -130,7 +130,7 @@ bool RsDiscSpace::checkForDiscSpace(RsDiscSpace::DiscLocation loc)
|
|||
{
|
||||
RsStackMutex m(_mtx) ; // Locked
|
||||
|
||||
if(_partials_path == "" || _download_path == "")
|
||||
if(_partials_path == "" && loc == RS_PARTIALS_DIRECTORY || _download_path == "" && loc == RS_DOWNLOAD_DIRECTORY)
|
||||
throw std::runtime_error("Download path and partial path not properly set in RsDiscSpace. Please call RsDiscSpace::setPartialsPath() and RsDiscSpace::setDownloadPath()") ;
|
||||
|
||||
time_t now = time(NULL) ;
|
||||
|
@ -160,6 +160,12 @@ bool RsDiscSpace::checkForDiscSpace(RsDiscSpace::DiscLocation loc)
|
|||
case RS_CONFIG_DIRECTORY: rs = crossSystemDiskStats(RsInit::RsConfigDirectory().c_str(),free_blocks,block_size) ;
|
||||
#ifdef DEBUG_RSDISCSPACE
|
||||
std::cerr << " path = " << RsInit::RsConfigDirectory() << std::endl ;
|
||||
#endif
|
||||
break ;
|
||||
|
||||
case RS_PGP_DIRECTORY: rs = crossSystemDiskStats(RsInit::RsPGPDirectory().c_str(),free_blocks,block_size) ;
|
||||
#ifdef DEBUG_RSDISCSPACE
|
||||
std::cerr << " path = " << RsInit::RsPGPDirectory() << std::endl ;
|
||||
#endif
|
||||
break ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue