From 3400e9b1221dd2e6c7b62bb1b16b2e3cf706b99f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 22 Oct 2013 18:55:58 -0700 Subject: [PATCH] Create directory if necessary. --- src/protocols/rdp/guac_rdpdr/rdpdr_fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c index 74110505..8104c385 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c @@ -199,6 +199,10 @@ int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path, } + /* Create directory first, if necessary */ + if (file_attributes & FILE_ATTRIBUTE_DIRECTORY && (flags & O_CREAT)) + mkdir(real_path, S_IRWXU); + /* Open file */ fd = open(real_path, flags, S_IRUSR | S_IWUSR); if (fd == -1)