From 471087c9d28a4058efc16f98784cb179ffc1e4c4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Jul 1998 22:21:24 +0000 Subject: Code added to fix the renaming of a directory under NT SMB calls. local.h: Changed MAXDIR to MAX_OPEN_DIRECTORIES - shmem size also tuned by this. dir.c: Use MAX_OPEN_DIRECTORIES. nttrans.c: Allow opening of a directory to succeed. Doesn't actually open a file descriptor but takes a files_struct slot marked as an fd. reply.c: Changed to close any outstanding is_directory files. reply_close changed to understand directory files. server.c: Added open_directory(), close_directory() calls. smb.h: Added is_directory to files_struct. Changed OPEN_FNUM to check that target is !is_directory (this prevents the normal file calls from processing a directory files_struct. Jeremy. (This used to be commit e01ce693f47e75e277f3440d46e32b0bd866b550) --- source3/include/smb.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'source3/include/smb.h') diff --git a/source3/include/smb.h b/source3/include/smb.h index ca295f3b42..921cb4284d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -418,14 +418,14 @@ typedef struct /* Structure used when SMBwritebmpx is active */ typedef struct - { - int wr_total_written; /* So we know when to discard this */ - int32 wr_timeout; - int32 wr_errclass; - int32 wr_error; /* Cached errors */ - BOOL wr_mode; /* write through mode) */ - BOOL wr_discard; /* discard all further data */ - } write_bmpx_struct; +{ + int wr_total_written; /* So we know when to discard this */ + int32 wr_timeout; + int32 wr_errclass; + int32 wr_error; /* Cached errors */ + BOOL wr_mode; /* write through mode) */ + BOOL wr_discard; /* discard all further data */ +} write_bmpx_struct; /* * Structure used to indirect fd's from the files_struct. @@ -467,6 +467,7 @@ typedef struct BOOL modified; BOOL granted_oplock; BOOL sent_oplock_break; + BOOL is_directory; BOOL reserved; char *name; } files_struct; @@ -781,7 +782,7 @@ struct parm_struct /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) -#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open) +#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open && !Files[fnum].is_directory) #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) #define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) #define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc) -- cgit