supplimental fix for bug #364599: some newly created profile files are write protected, for example bookmarks.html
in addtion to fixing the permissions of bookmarks.html, we need to fix the permissions of the bookmark.html.moztmp file, otherwise we'll still fail to modify bookmarks. r=dveditz git-svn-id: svn://10.0.0.236/trunk@218692 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1441,10 +1441,19 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
||||
backup.Append(destPath);
|
||||
backup.Append(L".moztmp");
|
||||
|
||||
// we are about to remove the .moztmp file,
|
||||
// so attempt to make sure the file is writable
|
||||
// (meaning: the "read only" attribute is not set)
|
||||
// _wchmod can silently fail (return -1) if
|
||||
// the file doesn't exist but that's ok, because
|
||||
// _wremove() will also silently fail if the file
|
||||
// doesn't exist.
|
||||
(void)_wchmod(backup.get(), _S_IREAD | _S_IWRITE);
|
||||
|
||||
// remove any existing backup file that we may already have.
|
||||
// maybe we should be doing some kind of unique naming here,
|
||||
// but why bother.
|
||||
_wremove(backup.get());
|
||||
(void)_wremove(backup.get());
|
||||
|
||||
// move destination file to backup file
|
||||
copyOK = ::MoveFileW(destPath.get(), backup.get());
|
||||
|
||||
Reference in New Issue
Block a user