supplimental fix for bug #364599:
Some new created profile files are write protected, for example bookmarks.html and localstore.rdf OR existing perms with 0600 instead of 0644 and fix some line endings from my first patch. r=dveditz git-svn-id: svn://10.0.0.236/trunk@218657 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
ef9cde08ee
commit
c9cf6824cd
@ -177,8 +177,8 @@ nsBrowserDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist,
|
||||
|
||||
file->AppendNative(leafstr);
|
||||
}
|
||||
|
||||
PRBool exists;
|
||||
|
||||
PRBool exists;
|
||||
rv = file->Exists(&exists);
|
||||
|
||||
if (restoreBookmarksBackup && NS_SUCCEEDED(rv) && exists) {
|
||||
@ -203,9 +203,9 @@ nsBrowserDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist,
|
||||
if (NS_SUCCEEDED(file->Exists(&fileToEnsureExists)) && fileToEnsureExists
|
||||
&& NS_SUCCEEDED(file->IsWritable(&isWritable)) && !isWritable) {
|
||||
PRUint32 permissions;
|
||||
if (NS_SUCCEEDED(file->GetPermissions(&permissions))) {
|
||||
rv = file->SetPermissions(permissions | 0644);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to ensure file permissions");
|
||||
if (NS_SUCCEEDED(file->GetPermissions(&permissions))) {
|
||||
rv = file->SetPermissions(permissions | 0600);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to ensure file permissions");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -374,9 +374,9 @@ nsXREDirProvider::GetFile(const char* aProperty, PRBool* aPersistent,
|
||||
if (NS_SUCCEEDED(file->Exists(&fileToEnsureExists)) && fileToEnsureExists
|
||||
&& NS_SUCCEEDED(file->IsWritable(&isWritable)) && !isWritable) {
|
||||
PRUint32 permissions;
|
||||
if (NS_SUCCEEDED(file->GetPermissions(&permissions))) {
|
||||
rv = file->SetPermissions(permissions | 0644);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to ensure file permissions");
|
||||
if (NS_SUCCEEDED(file->GetPermissions(&permissions))) {
|
||||
rv = file->SetPermissions(permissions | 0600);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to ensure file permissions");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user