mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 09:05:24 -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
|
@ -609,7 +609,8 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
|||
|
||||
get_configinit(RsInitConfig::basedir, RsInitConfig::preferedId);
|
||||
|
||||
std::string pgp_dir = RsInitConfig::basedir + "/pgp" ;
|
||||
std::string pgp_dir = RsPGPDirectory() ;
|
||||
|
||||
if(!RsDirUtil::checkCreateDirectory(pgp_dir))
|
||||
throw std::runtime_error("Cannot create pgp directory " + pgp_dir) ;
|
||||
|
||||
|
@ -719,7 +720,8 @@ bool RsInit::importIdentity(const std::string& fname,std::string& id,std::string
|
|||
|
||||
bool RsInit::copyGnuPGKeyrings()
|
||||
{
|
||||
std::string pgp_dir = RsInitConfig::basedir + "/pgp" ;
|
||||
std::string pgp_dir = RsPGPDirectory() ;
|
||||
|
||||
if(!RsDirUtil::checkCreateDirectory(pgp_dir))
|
||||
throw std::runtime_error("Cannot create pgp directory " + pgp_dir) ;
|
||||
|
||||
|
@ -1720,6 +1722,10 @@ std::string RsInit::RsConfigDirectory()
|
|||
{
|
||||
return RsInitConfig::basedir;
|
||||
}
|
||||
std::string RsInit::RsPGPDirectory()
|
||||
{
|
||||
return RsInitConfig::basedir + "/pgp" ;
|
||||
}
|
||||
|
||||
std::string RsInit::RsProfileConfigDirectory()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue