Change the ACL on our %temp% directories (bug #1125)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6657 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2015-12-07 20:49:46 +00:00
parent 0cac95475e
commit d7d6c3561d
7 changed files with 63 additions and 16 deletions

View file

@ -331,20 +331,23 @@ static int NSISCALL ExecuteEntry(entry *entry_)
TCHAR *buf1=GetStringFromParm(-0x10);
log_printf3(_T("CreateDirectory: \"%s\" (%d)"),buf1,parm1);
{
TCHAR *p = skip_root(buf1);
TCHAR c = _T('c');
TCHAR *p = skip_root(buf1), c = _T('c');
if (p)
{
while (c)
{
DWORD ec;
p = findchar(p, _T('\\'));
c = *p;
*p = 0;
if (!CreateDirectory(buf1, NULL))
c = *p, *p = 0;
if (!c && parm2 && UserIsAdminGrpMember()) // Lock down the final directory?
ec = CreateRestrictedDirectory(buf1);
else
ec = CreateNormalDirectory(buf1);
if (ec)
{
if (GetLastError() != ERROR_ALREADY_EXISTS)
if (ec != ERROR_ALREADY_EXISTS)
{
log_printf3(_T("CreateDirectory: can't create \"%s\" (err=%d)"),buf1,GetLastError());
log_printf3(_T("CreateDirectory: can't create \"%s\" (err=%d)"),buf1,ec);
exec_error++;
}
else if ((GetFileAttributes(buf1) & FILE_ATTRIBUTE_DIRECTORY) == 0)