summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-08-21 01:30:29 +0000
committerJeremy Allison <jra@samba.org>1998-08-21 01:30:29 +0000
commit81b580fd2248221c61e3d4dac03862fb1fd8fde5 (patch)
tree4dc0f808dc127beda15184b06506d11b701bbcee /source3/smbd/nttrans.c
parentdc76502cd8a950f6aff84ce4eedfd9d2b30d3dcc (diff)
downloadsamba-81b580fd2248221c61e3d4dac03862fb1fd8fde5.tar.gz
samba-81b580fd2248221c61e3d4dac03862fb1fd8fde5.tar.bz2
samba-81b580fd2248221c61e3d4dac03862fb1fd8fde5.zip
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)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c10
1 files changed, 9 insertions, 1 deletions
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 ));