From 81b580fd2248221c61e3d4dac03862fb1fd8fde5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 21 Aug 1998 01:30:29 +0000 Subject: Fixes for the problem in blocking locks with file_fsp returning the chain_fsp on close (if you don't know what this means, consider yourself lucky - this one took a day to track down :-). Jeremy. (This used to be commit 193cb5382464173e99a538867a266d793f0ceab5) --- source3/smbd/nttrans.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 236f1e2d30..596d15c2c7 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -28,6 +28,7 @@ extern int Client; extern int oplock_sock; extern int smb_read_error; extern int global_oplock_break; +extern int chain_size; extern BOOL case_sensitive; extern BOOL case_preserve; extern BOOL short_case_preserve; @@ -1029,7 +1030,7 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp) change_notify_buf *prev = NULL; while(cnbp != NULL) { - if(cnbp->fsp == fsp) { + if(cnbp->fsp->fnum == fsp->fnum) { free((char *)ubi_slRemNext( &change_notify_queue, prev)); cnbp = (change_notify_buf *)(prev ? ubi_slNext(prev) : ubi_slFirst(&change_notify_queue)); continue; @@ -1089,6 +1090,13 @@ void process_pending_change_notify_queue(time_t t) uint16 vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : SVAL(cnbp->request_buf,smb_uid); + /* + * Ensure we don't have any old chain_fsp values + * sitting around.... + */ + chain_size = 0; + file_chain_reset(); + if(!become_user(conn,vuid)) { DEBUG(0,("process_pending_change_notify_queue: Unable to become user vuid=%d.\n", vuid )); -- cgit