Bug 789422 - Part 2: Ensure that the update.status directory exists before attempting to write to it; r=rstrong

This commit is contained in:
Ehsan Akhgari 2012-09-10 16:32:59 -04:00
parent 70d8c279db
commit 83e9bdd98b

View File

@ -1634,6 +1634,10 @@ WriteStatusFile(const char* aStatus)
NS_tsnprintf(filename, sizeof(filename)/sizeof(filename[0]),
NS_T("%s/update.status"), gSourcePath);
// Make sure that the directory for the update status file exists
if (ensure_parent_dir(filename))
return false;
AutoFile file = NS_tfopen(filename, NS_T("wb+"));
if (file == NULL)
return false;