зеркало из https://github.com/mozilla/pjs.git
Followup to bug 224692 to only reset inherited permissions r+sr=bsmedberg
This commit is contained in:
Родитель
174dc21055
Коммит
9373f0a628
|
@ -1458,16 +1458,20 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
|||
rv = ConvertWinError(GetLastError());
|
||||
|
||||
#ifndef WINCE
|
||||
if(move) //Set security permissions to inherit from parent.
|
||||
else if (move) // Set security permissions to inherit from parent.
|
||||
{
|
||||
ACL empty_acl;
|
||||
if (InitializeAcl(&empty_acl, (DWORD) sizeof(ACL), ACL_REVISION))
|
||||
{
|
||||
::SetNamedSecurityInfoW((LPWSTR)destPath.get(), SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION |
|
||||
UNPROTECTED_DACL_SECURITY_INFORMATION,
|
||||
NULL, NULL, &empty_acl, NULL);
|
||||
}
|
||||
PACL pOldDACL = NULL;
|
||||
PSECURITY_DESCRIPTOR pSD = NULL;
|
||||
::GetNamedSecurityInfoW((LPWSTR)destPath.get(), SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION,
|
||||
NULL, NULL, &pOldDACL, NULL, &pSD);
|
||||
if (pOldDACL)
|
||||
::SetNamedSecurityInfoW((LPWSTR)destPath.get(), SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION |
|
||||
UNPROTECTED_DACL_SECURITY_INFORMATION,
|
||||
NULL, NULL, pOldDACL, NULL);
|
||||
if (pSD)
|
||||
LocalFree((HLOCAL)pSD);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче