summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-12 01:25:10 +0000
committerJeremy Allison <jra@samba.org>2000-04-12 01:25:10 +0000
commitafd40c8cde7da44757b6d2e2b27e010aacda5c9e (patch)
tree32d8ec21b045aebd630c20726f02db5f5c5116ab
parente1083ea7df16323e63efb6f752a6d5c6f0c4910e (diff)
downloadsamba-afd40c8cde7da44757b6d2e2b27e010aacda5c9e.tar.gz
samba-afd40c8cde7da44757b6d2e2b27e010aacda5c9e.tar.bz2
samba-afd40c8cde7da44757b6d2e2b27e010aacda5c9e.zip
Ensure that CHECK_FNUM rejects fd == -1 correctly.
Jeremy. (This used to be commit d2fff2596ad1585fc6a5e033fe8410fe5438a57b)
-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) \