Bug 729212. (Av1a) abTrees.js: Use a safe-file-output-stream. r+moa=mnyromyr.
--- a/suite/mailnews/addrbook/abTrees.js
+++ b/suite/mailnews/addrbook/abTrees.js
@@ -158,21 +158,21 @@ directoryTreeView.prototype =
if (aJSONFile)
{
// Write out our json file...
let data = JSON.stringify(this._persistOpenMap);
let file = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);
file.append(aJSONFile);
- let foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
+ let foStream = Components.classes["@mozilla.org/network/safe-file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
-
foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
foStream.write(data, data.length);
+ foStream.QueryInterface(Components.interfaces.nsISafeOutputStream).finish();
foStream.close();
}
},
// Override the dnd methods for those functions in abDragDrop.js
canDrop: function dtv_canDrop(aIndex, aOrientation)
{
return abDirTreeObserver.canDrop(aIndex, aOrientation);