mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
fixes bug 309183 "Software update fails if user lacks write permissions on the 'update' folder/directory" patch by Ben Turner (bent.mozilla@gmail.com), r=darin
This commit is contained in:
parent
3a6bb4abe9
commit
3d25eb56cf
@ -1166,10 +1166,17 @@ UpdateService.prototype = {
|
||||
*/
|
||||
get canUpdate() {
|
||||
try {
|
||||
var file = getFile(KEY_APPDIR, [FILE_PERMS_TEST]);
|
||||
if (!file.exists()) {
|
||||
file.create(nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
file.remove(false);
|
||||
var appDirFile = getFile(KEY_APPDIR, [FILE_PERMS_TEST]);
|
||||
if (!appDirFile.exists()) {
|
||||
appDirFile.create(nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
appDirFile.remove(false);
|
||||
}
|
||||
var updateDir = getUpdatesDir();
|
||||
var upDirFile = updateDir.clone();
|
||||
upDirFile.append(FILE_PERMS_TEST);
|
||||
if (!upDirFile.exists()) {
|
||||
upDirFile.create(nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
upDirFile.remove(false);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user