From d9832d1190ee23bf7a7522a8f3d147b505adf2c5 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 20 Oct 2008 16:14:35 +0000 Subject: [PATCH] correct O_RDONLY sftp bug with windows systems git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@181 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/sftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libssh/sftp.c b/libssh/sftp.c index e0eb14d6..bdb966d9 100644 --- a/libssh/sftp.c +++ b/libssh/sftp.c @@ -845,8 +845,8 @@ SFTP_FILE *sftp_open(SFTP_SESSION *sftp, char *file, int access, SFTP_ATTRIBUTES u32 id=sftp_get_new_id(sftp); BUFFER *buffer=buffer_new(); STRING *filename; - if(access & O_RDONLY) - flags|=SSH_FXF_READ; + if(access == O_RDONLY) + flags|=SSH_FXF_READ; // if any of the other flag is set, READ should not be set initialy if(access & O_WRONLY) flags |= SSH_FXF_WRITE; if(access & O_RDWR)