Skip to content
Snippets Groups Projects
Commit 4aafdfd1 authored by Oz Linden's avatar Oz Linden
Browse files

add catch for possible exception in llsechandler_basic destructor (crash on exit)

parent e19809cb
No related branches found
No related tags found
No related merge requests found
...@@ -1364,6 +1364,7 @@ void LLSecAPIBasicHandler::_writeProtectedData() ...@@ -1364,6 +1364,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
} }
catch (...) catch (...)
{ {
LL_WARNS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL;
// it's good practice to clean up any secure information on error // it's good practice to clean up any secure information on error
// (even though this file isn't really secure. Perhaps in the future // (even though this file isn't really secure. Perhaps in the future
// it may be, however. // it may be, however.
...@@ -1372,20 +1373,35 @@ void LLSecAPIBasicHandler::_writeProtectedData() ...@@ -1372,20 +1373,35 @@ void LLSecAPIBasicHandler::_writeProtectedData()
// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData() // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
// Decided throwing an exception here was overkill until we figure out why this happens // Decided throwing an exception here was overkill until we figure out why this happens
//throw LLProtectedDataException("Error writing Protected Data Store"); //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. try
if((((LLFile::isfile(mProtectedDataFilename) != 0) && {
(LLFile::remove(mProtectedDataFilename) != 0))) || // move the temporary file to the specified file location.
(LLFile::rename(tmp_filename, mProtectedDataFilename))) 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); 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 // Decided throwing an exception here was overkill until we figure out why this happens
//throw LLProtectedDataException("Could not overwrite protected data store"); //throw LLProtectedDataException("Error writing Protected Data Store");
LL_INFOS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment