CHROOT - fix symbolic link that refers to a network share (#596)
This commit is contained in:
parent
4833ddaeb8
commit
cf06f991f9
|
@ -46,5 +46,4 @@ try
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,6 +427,14 @@ file_in_chroot_jail(HANDLE handle) {
|
||||||
if (!final_path)
|
if (!final_path)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
const wchar_t* uncPrefix = L"UNC\\";
|
||||||
|
int isUNCPath = memcmp(final_path, uncPrefix, 2 * wcslen(uncPrefix));
|
||||||
|
|
||||||
|
if (0 == isUNCPath) {
|
||||||
|
debug3("symlink points to UNCPath");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
to_wlower_case(final_path);
|
to_wlower_case(final_path);
|
||||||
if ((wcslen(final_path) < wcslen(chroot_pathw)) ||
|
if ((wcslen(final_path) < wcslen(chroot_pathw)) ||
|
||||||
memcmp(final_path, chroot_pathw, 2 * wcslen(chroot_pathw)) != 0 ||
|
memcmp(final_path, chroot_pathw, 2 * wcslen(chroot_pathw)) != 0 ||
|
||||||
|
|
Loading…
Reference in New Issue