sys: FspUnicodePathIsValid()

This commit is contained in:
Bill Zissimopoulos
2016-02-10 11:37:28 -08:00
parent cc19ddcd92
commit 5d26211c38
3 changed files with 39 additions and 1 deletions

View File

@ -809,6 +809,9 @@ static NTSTATUS FspFsvolSetRenameInformation(
if (FileNode->IsRootDirectory)
/* cannot rename root directory */
return STATUS_INVALID_PARAMETER;
if (!FspUnicodePathIsValid(&FileNode->FileName, FALSE))
/* cannot rename streams (WinFsp limitation) */
return STATUS_INVALID_PARAMETER;
if (0 != TargetFileNode)
{
@ -831,6 +834,13 @@ static NTSTATUS FspFsvolSetRenameInformation(
if (L'\\' == Suffix.Buffer[0])
FspUnicodePathSuffix(&Suffix, &NewFileName, &Suffix);
if (!FspUnicodePathIsValid(&Remain, FALSE) || !FspUnicodePathIsValid(&Suffix, FALSE))
{
/* cannot rename streams (WinFsp limitation) */
Result = STATUS_INVALID_PARAMETER;
goto unlock_exit;
}
AppendBackslash = sizeof(WCHAR) < Remain.Length;
NewFileName.Length = NewFileName.MaximumLength =
Remain.Length + AppendBackslash * sizeof(WCHAR) + Suffix.Length;