mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 06:40:58 -04:00
fixed initialisation of random salt in directory updater when no config file is present
This commit is contained in:
parent
eedeaebbe7
commit
cf8dac2e74
1 changed files with 11 additions and 8 deletions
|
@ -99,6 +99,7 @@ void p3FileDatabase::setSharedDirectories(const std::list<SharedDirInfo>& shared
|
||||||
|
|
||||||
mLocalSharedDirs->setSharedDirectoryList(shared_dirs) ;
|
mLocalSharedDirs->setSharedDirectoryList(shared_dirs) ;
|
||||||
mLocalDirWatcher->forceUpdate();
|
mLocalDirWatcher->forceUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IndicateConfigChanged();
|
IndicateConfigChanged();
|
||||||
|
@ -423,14 +424,6 @@ bool p3FileDatabase::loadList(std::list<RsItem *>& load)
|
||||||
|
|
||||||
delete *it ;
|
delete *it ;
|
||||||
}
|
}
|
||||||
if(mLocalDirWatcher->hashSalt().isNull())
|
|
||||||
{
|
|
||||||
std::cerr << "(WW) Initialising directory watcher salt to some random value " << std::endl;
|
|
||||||
mLocalDirWatcher->setHashSalt(RsFileHash::random()) ;
|
|
||||||
|
|
||||||
IndicateConfigChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* set directories */
|
/* set directories */
|
||||||
mLocalSharedDirs->setSharedDirectoryList(dirList);
|
mLocalSharedDirs->setSharedDirectoryList(dirList);
|
||||||
|
@ -547,6 +540,16 @@ void p3FileDatabase::cleanup()
|
||||||
#endif
|
#endif
|
||||||
++it ;
|
++it ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is needed at least here, because loadList() might never have been called, if there is no config file present.
|
||||||
|
|
||||||
|
if(mLocalDirWatcher->hashSalt().isNull())
|
||||||
|
{
|
||||||
|
std::cerr << "(WW) Initialising directory watcher salt to some random value " << std::endl;
|
||||||
|
mLocalDirWatcher->setHashSalt(RsFileHash::random()) ;
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue