зеркало из https://github.com/mozilla/pjs.git
Bug 224692 - Downloaded files don't inherit NTFS properties... on nsILocalFile.moveTo use the NTFS permissions inherited from the new folder, instead of keeping permissions from the old location, r=bsmedberg
This commit is contained in:
Родитель
f3dacbc769
Коммит
e7ab991afb
|
@ -62,6 +62,7 @@
|
|||
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <aclapi.h>
|
||||
|
||||
#include "shellapi.h"
|
||||
#include "shlguid.h"
|
||||
|
@ -1448,6 +1449,19 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
|||
if (!copyOK) // CopyFile and MoveFileEx return zero at failure.
|
||||
rv = ConvertWinError(GetLastError());
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче