summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv/devredir.c
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/chansrv/devredir.c')
-rw-r--r--sesman/chansrv/devredir.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c
index 418c29e7..1f9eb492 100644
--- a/sesman/chansrv/devredir.c
+++ b/sesman/chansrv/devredir.c
@@ -68,7 +68,7 @@
#define log_info(_params...) \
{ \
- if (LOG_INFO <= LOG_LEVEL) \
+ if (LOG_INFO <= LOG_LEVEL) \
{ \
g_write("[%10.10u]: DEV_REDIR %s: %d : ", \
g_time3(), __func__, __LINE__); \
@@ -78,7 +78,7 @@
#define log_debug(_params...) \
{ \
- if (LOG_DEBUG <= LOG_LEVEL) \
+ if (LOG_DEBUG <= LOG_LEVEL) \
{ \
g_write("[%10.10u]: DEV_REDIR %s: %d : ", \
g_time3(), __func__, __LINE__); \
@@ -1101,7 +1101,11 @@ dev_redir_file_open(void *fusep, tui32 device_id, char *path,
#if 1
/* without the 0x00000010 rdesktop opens files in */
/* O_RDONLY instead of O_RDWR mode */
- DesiredAccess = DA_FILE_READ_DATA | DA_FILE_WRITE_DATA | DA_SYNCHRONIZE | 0x00000010;
+ if (mode & O_RDWR)
+ DesiredAccess = DA_FILE_READ_DATA | DA_FILE_WRITE_DATA | DA_SYNCHRONIZE | 0x00000010;
+ else
+ DesiredAccess = DA_FILE_READ_DATA | DA_SYNCHRONIZE;
+
CreateOptions = CO_FILE_SYNCHRONOUS_IO_NONALERT;
CreateDisposition = CD_FILE_OPEN; // WAS 1
#else