Author: mjansen
Date: Tue Aug 15 12:37:25 2017
New Revision: 75552
URL:
http://svn.reactos.org/svn/reactos?rev=75552&view=rev
Log:
[ACPPAGE] Do not allow shims to be applied to files in System32/WinSxs.
CORE-13618
Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLaye…
==============================================================================
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] Tue Aug 15
12:37:25 2017
@@ -158,6 +158,27 @@
}
return InitFile(Buffer);
}
+
+ CString tmp;
+ if (tmp.GetEnvironmentVariable(L"SystemRoot"))
+ {
+ tmp += L"\\System32";
+ if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
+ ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower())
+ {
+ ACDBG(L"Ignoring System32: %s\r\n", (PCWSTR)ExpandedFilename);
+ return E_FAIL;
+ }
+ tmp.GetEnvironmentVariable(L"SystemRoot");
+ tmp += L"\\WinSxs";
+ if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
+ ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower())
+ {
+ ACDBG(L"Ignoring WinSxs: %s\r\n", (PCWSTR)ExpandedFilename);
+ return E_FAIL;
+ }
+ }
+
for (size_t n = 0; g_AllowedExtensions[n]; ++n)
{
if (!wcsicmp(g_AllowedExtensions[n], pwszExt))