From af8a691db11a5072865f8b03fd1cbd3aab5cb6d7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Jul 2005 04:51:27 +0000 Subject: 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. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb) --- source3/include/doserr.h | 3 + source3/include/ntlmssp.h | 1 - source3/include/smb.h | 140 ++++++++++++++++++++++--------------------- source3/include/smb_macros.h | 11 ++-- source3/include/vfs.h | 3 +- 5 files changed, 84 insertions(+), 74 deletions(-) (limited to 'source3/include') diff --git a/source3/include/doserr.h b/source3/include/doserr.h index 77255ee4c1..647f11527b 100644 --- a/source3/include/doserr.h +++ b/source3/include/doserr.h @@ -63,6 +63,9 @@ #define ERRinvalidname 123 /* Invalid name */ #define ERRunknownlevel 124 #define ERRnotlocked 158 /* This region is not locked by this locking context. */ +#define ERRinvalidpath 161 +#define ERRcancelviolation 173 +#define ERRnoatomiclocks 174 #define ERRrename 183 #define ERRbadpipe 230 /* Named pipe invalid */ #define ERRpipebusy 231 /* All instances of pipe are busy */ diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index 8ab6265673..267779c434 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -124,7 +124,6 @@ typedef struct ntlmssp_state * * @param ntlmssp_state This structure * @param challenge 8 bytes of data, agreed by the client and server to be the effective challenge for NTLM2 authentication - * @param challange 8 bytes of data, agreed by the client and server to be the effective challenge for NTLM2 authentication * */ NTSTATUS (*set_challenge)(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *challenge); diff --git a/source3/include/smb.h b/source3/include/smb.h index 50bd233da7..55baf84531 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -107,44 +107,32 @@ typedef int BOOL; #define DOS_OPEN_FCB 0xF /* define shifts and masks for share and open modes. */ -#define OPEN_MODE_MASK 0xF -#define SHARE_MODE_SHIFT 4 -#define SHARE_MODE_MASK 0x7 -#define GET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) -#define SET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) -#define GET_DENY_MODE(x) (((x)>>SHARE_MODE_SHIFT) & SHARE_MODE_MASK) -#define SET_DENY_MODE(x) (((x) & SHARE_MODE_MASK) <>DENY_MODE_SHIFT) & DENY_MODE_MASK) +#define SET_DENY_MODE(x) (((x) & DENY_MODE_MASK) <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) ) diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 71b4f65627..7f6c94f6e9 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -58,7 +58,8 @@ /* Changed to version 11 to include seekdir/telldir/rewinddir calls. JRA */ /* Changed to version 12 to add mask and attributes to opendir(). JRA Also include aio calls. JRA. */ -#define SMB_VFS_INTERFACE_VERSION 12 +/* Changed to version 13 as the internal structure of files_struct has changed. JRA */ +#define SMB_VFS_INTERFACE_VERSION 13 /* to bug old modules which are trying to compile with the old functions */ -- cgit