aboutsummaryrefslogtreecommitdiff
path: root/libssh/sftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/sftp.c')
-rw-r--r--libssh/sftp.c4
1 files 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)