summaryrefslogtreecommitdiff
path: root/indra/newview/llsechandler_basic.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-04-28 13:36:35 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-04-28 13:36:35 +0300
commitbb87365c37047a35bf524a98d5a48cdb2d56948e (patch)
tree5b44b30944f794c2e2f78a0990cf56f81d27fa78 /indra/newview/llsechandler_basic.cpp
parenta89f3f29a0af37c7f3e78e38acb78f78e99dae78 (diff)
parentfde0868231a25b8c9ce03a86cb53f1738d35688d (diff)
Merge viewer-release, become version 3.7.29
Diffstat (limited to 'indra/newview/llsechandler_basic.cpp')
-rwxr-xr-xindra/newview/llsechandler_basic.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index fc9d9f0842..40516f9bbb 100755
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -640,7 +640,7 @@ LLBasicCertificateStore::~LLBasicCertificateStore()
// persist the store
void LLBasicCertificateStore::save()
{
- llofstream file_store(mFilename, llofstream::binary);
+ llofstream file_store(mFilename.c_str(), std::ios_base::binary);
if(!file_store.fail())
{
for(iterator cert = begin();
@@ -1331,7 +1331,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
std::string tmp_filename = mProtectedDataFilename + ".tmp";
llofstream protected_data_stream(tmp_filename.c_str(),
- llofstream::binary);
+ std::ios_base::binary);
try
{
@@ -1364,6 +1364,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
}
catch (...)
{
+ LL_WARNS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL;
// it's good practice to clean up any secure information on error
// (even though this file isn't really secure. Perhaps in the future
// it may be, however.
@@ -1372,20 +1373,35 @@ void LLSecAPIBasicHandler::_writeProtectedData()
// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
// Decided throwing an exception here was overkill until we figure out why this happens
//throw LLProtectedDataException("Error writing Protected Data Store");
- LL_INFOS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL;
}
- // move the temporary file to the specified file location.
- if((((LLFile::isfile(mProtectedDataFilename) != 0) &&
- (LLFile::remove(mProtectedDataFilename) != 0))) ||
- (LLFile::rename(tmp_filename, mProtectedDataFilename)))
+ try
+ {
+ // move the temporary file to the specified file location.
+ if((( (LLFile::isfile(mProtectedDataFilename) != 0)
+ && (LLFile::remove(mProtectedDataFilename) != 0)))
+ || (LLFile::rename(tmp_filename, mProtectedDataFilename)))
+ {
+ LL_WARNS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL;
+ LLFile::remove(tmp_filename);
+
+ // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
+ // Decided throwing an exception here was overkill until we figure out why this happens
+ //throw LLProtectedDataException("Could not overwrite protected data store");
+ }
+ }
+ catch (...)
{
+ LL_WARNS() << "LLProtectedDataException(Error renaming '" << tmp_filename
+ << "' to '" << mProtectedDataFilename << "')" << LL_ENDL;
+ // it's good practice to clean up any secure information on error
+ // (even though this file isn't really secure. Perhaps in the future
+ // it may be, however.
LLFile::remove(tmp_filename);
- // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
+ //crash in LLSecAPIBasicHandler::_writeProtectedData()
// Decided throwing an exception here was overkill until we figure out why this happens
- //throw LLProtectedDataException("Could not overwrite protected data store");
- LL_INFOS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL;
+ //throw LLProtectedDataException("Error writing Protected Data Store");
}
}
@@ -1552,7 +1568,7 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword()
{
const S32 HASHED_LENGTH = 32;
std::vector<U8> buffer(HASHED_LENGTH);
- llifstream password_file(mLegacyPasswordPath, llifstream::binary);
+ llifstream password_file(mLegacyPasswordPath.c_str(), llifstream::binary);
if(password_file.fail())
{