summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb_macros.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index 496787ee13..cc9f158af8 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -80,7 +80,10 @@
#define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn)
#define CHECK_FSP(fsp,conn) if (!FNUM_OK(fsp,conn)) \
- return(ERROR(ERRDOS,ERRbadfid))
+ return(ERROR(ERRDOS,ERRbadfid)); \
+ else if((fsp)->fd == -1) \
+ return(ERROR(ERRDOS,ERRbadaccess))
+
#define CHECK_READ(fsp) if (!(fsp)->can_read) \
return(ERROR(ERRDOS,ERRbadaccess))
#define CHECK_WRITE(fsp) if (!(fsp)->can_write) \