Skip to content
Permalink
Browse files

fix 5049 - create dir & elevation

  • Loading branch information...
alabuzhev committed Oct 11, 2017
1 parent 4412ad4 commit abeb30b65aa58b6b04e40d5e6d9b6525d72183d1
Showing with 10 additions and 3 deletions.
  1. +4 −0 far/changelog
  2. +5 −2 far/platform.fs.cpp
  3. +1 −1 far/vbuild.m4
@@ -1,3 +1,7 @@
drkns 11.10.2017 22:04:47 +0100 - build 5064

1. В 5049 погнулось повышение привилегий при создании папки.

zg 08.10.2017 14:45:39 +0300 - build 5063

1. 0003514: Возможность задать приоритет макросов, определяемым через MCTL_ADDMACRO.
@@ -1152,7 +1152,7 @@ namespace os::fs

bool create_directory(const wchar_t* TemplateDirectory, const wchar_t* NewDirectory, SECURITY_ATTRIBUTES* SecurityAttributes)
{
return (TemplateDirectory? ::CreateDirectoryEx(TemplateDirectory, NewDirectory, SecurityAttributes) : ::CreateDirectory(NewDirectory, SecurityAttributes)) != FALSE;
return (*TemplateDirectory? ::CreateDirectoryEx(TemplateDirectory, NewDirectory, SecurityAttributes) : ::CreateDirectory(NewDirectory, SecurityAttributes)) != FALSE;
}

bool remove_directory(const wchar_t* PathName)
@@ -1329,7 +1329,7 @@ namespace os::fs

const auto& Create = [&](const string& Template)
{
if (low::create_directory(EmptyToNull(Template.data()), NtNewDirectory.data(), SecurityAttributes))
if (low::create_directory(Template.data(), NtNewDirectory.data(), SecurityAttributes))
return true;

if (ElevationRequired(ELEVATION_MODIFY_REQUEST))
@@ -1338,6 +1338,9 @@ namespace os::fs
return false;
};

if (TemplateDirectory.empty())
return Create({});

return Create(NTPath(TemplateDirectory)) ||
// CreateDirectoryEx may fail on some FS, try to create anyway.
Create({});
@@ -1 +1 @@
m4_define(BUILD,5063)m4_dnl
m4_define(BUILD,5064)m4_dnl

0 comments on commit abeb30b

Please sign in to comment.
You can’t perform that action at this time.