svn commit: samba r16760 - in trunk/source/include: .
jra at samba.org
jra at samba.org
Sun Jul 2 20:40:56 GMT 2006
Author: jra
Date: 2006-07-02 20:40:53 +0000 (Sun, 02 Jul 2006)
New Revision: 16760
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16760
Log:
Fix checking of the order of NT errors for bad fsp/conn
pairs. We now pass Samba4 RAW-SAMBA3CHECKFSP.
Jeremy.
Modified:
trunk/source/include/smb_macros.h
Changeset:
Modified: trunk/source/include/smb_macros.h
===================================================================
--- trunk/source/include/smb_macros.h 2006-07-02 17:40:35 UTC (rev 16759)
+++ trunk/source/include/smb_macros.h 2006-07-02 20:40:53 UTC (rev 16760)
@@ -91,7 +91,7 @@
#define FSP_BELONGS_CONN(fsp,conn) do {\
extern struct current_user current_user;\
if (!((fsp) && (conn) && ((conn)==(fsp)->conn) && (current_user.vuid==(fsp)->vuid))) \
- return(ERROR_DOS(ERRDOS,ERRbadfid));\
+ return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
} while(0)
#define FNUM_OK(fsp,c) ((fsp) && !(fsp)->is_directory && (c)==(fsp)->conn && current_user.vuid==(fsp)->vuid)
@@ -101,11 +101,13 @@
*/
#define CHECK_FSP(fsp,conn) do {\
extern struct current_user current_user;\
- if ((fsp) && (fsp)->is_directory) \
+ if (!(fsp) || !(conn)) \
+ return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
+ else if (((conn) != (fsp)->conn) || current_user.vuid != (fsp)->vuid) \
+ return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
+ else if ((fsp)->is_directory) \
return ERROR_NT(NT_STATUS_INVALID_DEVICE_REQUEST); \
- else if (!FNUM_OK(fsp,conn)) \
- return ERROR_NT(NT_STATUS_INVALID_HANDLE); \
- else if((fsp)->fh->fd == -1) \
+ else if ((fsp)->fh->fd == -1) \
return ERROR_NT(NT_STATUS_ACCESS_DENIED); \
(fsp)->num_smb_operations++;\
} while(0)
More information about the samba-cvs
mailing list