From afd40c8cde7da44757b6d2e2b27e010aacda5c9e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Apr 2000 01:25:10 +0000 Subject: Ensure that CHECK_FNUM rejects fd == -1 correctly. Jeremy. (This used to be commit d2fff2596ad1585fc6a5e033fe8410fe5438a57b) --- source3/include/smb_macros.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) \ -- cgit