From 911746ae2484e40eb6e76018fd2a1bba991bf1bb Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 22 Oct 2013 10:56:47 -0700 Subject: [PATCH] Add options for file attributes and create options to open. Fix create disposition of files in directory list. --- src/protocols/rdp/guac_rdpdr/rdpdr_fs.c | 5 +++-- src/protocols/rdp/guac_rdpdr/rdpdr_fs.h | 3 ++- src/protocols/rdp/guac_rdpdr/rdpdr_fs_messages.c | 16 +++------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c index 519acec5..74110505 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.c @@ -111,8 +111,9 @@ static void __guac_rdpdr_fs_translate_path(guac_rdpdr_device* device, } -int guac_rdpdr_fs_open(guac_rdpdr_device* device, - const char* path, int access, int create_disposition) { +int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path, + int access, int file_attributes, int create_disposition, + int create_options) { guac_rdpdr_fs_data* data = (guac_rdpdr_fs_data*) device->data; char real_path[GUAC_RDPDR_FS_MAX_PATH]; diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.h b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.h index d4eb6593..864ee1d8 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs.h +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs.h @@ -239,7 +239,8 @@ int guac_rdpdr_fs_convert_path(const char* parent, const char* rel_path, char* a * if an error occurs. */ int guac_rdpdr_fs_open(guac_rdpdr_device* device, const char* path, - int access, int create_disposition); + int access, int file_attributes, int create_disposition, + int create_options); /** * Frees the given file ID, allowing future open operations to reuse it. diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs_messages.c b/src/protocols/rdp/guac_rdpdr/rdpdr_fs_messages.c index 6e2ddddb..1e9075d8 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs_messages.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs_messages.c @@ -78,23 +78,13 @@ void guac_rdpdr_fs_process_create(guac_rdpdr_device* device, /* FIXME: Validate path length */ - /* STUB: create_options */ - guac_client_log_info(device->rdpdr->client, - "%s: STUB: Unused variable: create_options (%i)", __func__, - create_options); - - /* STUB: file_attributes */ - guac_client_log_info(device->rdpdr->client, - "%s: STUB: Unused variable: file_attributes (%i)", __func__, - file_attributes); - /* Convert path to UTF-8 */ guac_rdp_utf16_to_utf8(Stream_Pointer(input_stream), path, path_length/2 - 1); /* Open file */ - file_id = guac_rdpdr_fs_open(device, path, desired_access, - create_disposition); + file_id = guac_rdpdr_fs_open(device, path, desired_access, file_attributes, + create_disposition, create_options); /* Write header */ Stream_Write_UINT16(output_stream, RDPDR_CTYP_CORE); @@ -499,7 +489,7 @@ void guac_rdpdr_fs_process_query_directory(guac_rdpdr_device* device, wStream* i /* Open directory entry */ entry_file_id = guac_rdpdr_fs_open(device, entry_path, - ACCESS_FILE_READ_DATA, DISP_FILE_OVERWRITE); + ACCESS_FILE_READ_DATA, 0, DISP_FILE_OPEN, 0); if (entry_file_id >= 0) {