diff options
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sftp-server.c b/sftp-server.c index 3619cdfc0..df0fb5068 100644 --- a/sftp-server.c +++ b/sftp-server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-server.c,v 1.110 2016/09/12 01:22:38 deraadt Exp $ */ | 1 | /* $OpenBSD: sftp-server.c,v 1.111 2017/04/04 00:24:56 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -691,8 +691,8 @@ process_open(u_int32_t id) | |||
691 | logit("open \"%s\" flags %s mode 0%o", | 691 | logit("open \"%s\" flags %s mode 0%o", |
692 | name, string_from_portable(pflags), mode); | 692 | name, string_from_portable(pflags), mode); |
693 | if (readonly && | 693 | if (readonly && |
694 | ((flags & O_ACCMODE) == O_WRONLY || | 694 | ((flags & O_ACCMODE) != O_RDONLY || |
695 | (flags & O_ACCMODE) == O_RDWR)) { | 695 | (flags & (O_CREAT|O_TRUNC)) != 0)) { |
696 | verbose("Refusing open request in read-only mode"); | 696 | verbose("Refusing open request in read-only mode"); |
697 | status = SSH2_FX_PERMISSION_DENIED; | 697 | status = SSH2_FX_PERMISSION_DENIED; |
698 | } else { | 698 | } else { |