summaryrefslogtreecommitdiffstats
path: root/source/include/smb_macros.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-07-08 04:51:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:18 -0500
commitc7fe18761e2c753afbffd3a78abff46472a9b8eb (patch)
treef60b3a473919fe3a6294822226bd950b8d832c70 /source/include/smb_macros.h
parent053e892e07936f6b71a6bb5e31be09c1d2a2c837 (diff)
downloadsamba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.tar.gz
samba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.tar.xz
samba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.zip
r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy.
Diffstat (limited to 'source/include/smb_macros.h')
-rw-r--r--source/include/smb_macros.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h
index b7e27d22667..7a0afdfc192 100644
--- a/source/include/smb_macros.h
+++ b/source/include/smb_macros.h
@@ -101,15 +101,16 @@
extern struct current_user current_user;\
if (!FNUM_OK(fsp,conn)) \
return(ERROR_DOS(ERRDOS,ERRbadfid)); \
- else if((fsp)->fd == -1) \
+ else if((fsp)->fh->fd == -1) \
return(ERROR_DOS(ERRDOS,ERRbadaccess));\
(fsp)->num_smb_operations++;\
} while(0)
-#define CHECK_READ(fsp) if (!(fsp)->can_read) \
- return(ERROR_DOS(ERRDOS,ERRbadaccess))
-#define CHECK_WRITE(fsp) if (!(fsp)->can_write) \
- return(ERROR_DOS(ERRDOS,ERRbadaccess))
+#define CHECK_READ(fsp,inbuf) (((fsp)->fh->fd != -1) && ((fsp)->can_read || \
+ ((SVAL((inbuf),smb_flg2) & FLAGS2_READ_PERMIT_EXECUTE) && \
+ (fsp->access_mask & FILE_EXECUTE))))
+
+#define CHECK_WRITE(fsp) ((fsp)->can_write && ((fsp)->fh->fd != -1))
#define ERROR_WAS_LOCK_DENIED(status) (NT_STATUS_EQUAL((status), NT_STATUS_LOCK_NOT_GRANTED) || \
NT_STATUS_EQUAL((status), NT_STATUS_FILE_LOCK_CONFLICT) )