Fix FreeRDP Issue #661.

Check directory operations in rdpdr to determine if the directory should be created if it does not exist - instead of always just creating a directory regardless.
This commit is contained in:
Brent Collins 2012-08-01 15:05:33 -05:00
parent 4a3691687b
commit 9b8044aa6a

View File

@ -199,10 +199,14 @@ static boolean disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 Crea
file->is_dir = ((CreateOptions & FILE_DIRECTORY_FILE) ? true : false);
if (file->is_dir)
{
if (mkdir(file->fullpath, mode) != 0)
//Should only create the directory if the disposition allows for it
if ((CreateDisposition == FILE_OPEN_IF) || (CreateDisposition == FILE_CREATE))
{
if (mkdir(file->fullpath, mode) != 0)
{
file->err = errno;
return true;
}
}
}
exists = false;