fixes bug 313240 "Update service fails via exception when run as non-privileged user" patch by Ben Turner (bent.mozilla@gmail.com), r=darin

git-svn-id: svn://10.0.0.236/trunk@182721 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net 2005-10-21 18:17:02 +00:00
parent 43bb61b3d6
commit fe78f13ec8

View File

@ -330,8 +330,11 @@ function writeStatusFile(dir, state) {
* Removes the Updates Directory
*/
function cleanUpUpdatesDir() {
// Bail out if we don't have appropriate permissions
if (!this.canUpdate)
return;
var updateDir = getUpdatesDir();
var e = updateDir.directoryEntries;
while (e.hasMoreElements()) {
var f = e.getNext().QueryInterface(Components.interfaces.nsIFile);
@ -922,6 +925,11 @@ UpdateService.prototype = {
*/
_postUpdateProcessing: function() {
// Detect installation failures and notify
// Bail out if we don't have appropriate permissions
if (!this.canUpdate)
return;
var status = readStatusFile(getUpdatesDir());
if (status == STATE_DOWNLOADING) {
LOG("UpdateService", "_postUpdateProcessing: Downloading patch, resuming...");