diff options
author | Jeremy Allison <jra@samba.org> | 1999-01-21 02:41:42 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1999-01-21 02:41:42 +0000 |
commit | 1cea3dc96fb09a6016f46aad86b79af4f1600c85 (patch) | |
tree | 342a8ed11cb56e4ddd52fb5bb8790cd177bbc537 /source/smbd/nttrans.c | |
parent | 9a274b4e760c974f438616dbceb44420ea3ef19d (diff) | |
download | samba-1cea3dc96fb09a6016f46aad86b79af4f1600c85.tar.gz samba-1cea3dc96fb09a6016f46aad86b79af4f1600c85.tar.xz samba-1cea3dc96fb09a6016f46aad86b79af4f1600c85.zip |
Added code to let NT do a 'delete on close' request on an open
directory handle. WinCenter (multi-user NT system) is doing
this. This code still needs testing....
Jeremy.
Diffstat (limited to 'source/smbd/nttrans.c')
-rw-r--r-- | source/smbd/nttrans.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index 5ea2ae0c73a..e7811c605b5 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -789,7 +789,7 @@ int reply_ntcreate_and_X(connection_struct *conn, if(fsp->is_directory) { if(dos_stat(fsp->fsp_name, &sbuf) != 0) { - close_directory(fsp); + close_directory(fsp,True); restore_case_semantics(file_attributes); return(ERROR(ERRDOS,ERRnoaccess)); } @@ -1385,6 +1385,33 @@ static void remove_pending_change_notify_requests_by_mid(int mid) } /**************************************************************************** + Delete entries by filename and cnum from the change notify pending queue. + Always send reply. +*****************************************************************************/ + +void remove_pending_change_notify_requests_by_filename(files_struct *fsp) +{ + change_notify_buf *cnbp = (change_notify_buf *)ubi_slFirst( &change_notify_queue ); + change_notify_buf *prev = NULL; + + while(cnbp != NULL) { + /* + * We know it refers to the same directory if the connection number and + * the filename are identical. + */ + if((cnbp->fsp->conn == fsp->conn) && strequal(cnbp->fsp->fsp_name,fsp->fsp_name)) { + change_notify_reply_packet(cnbp->request_buf,0,NT_STATUS_CANCELLED); + free((char *)ubi_slRemNext( &change_notify_queue, prev)); + cnbp = (change_notify_buf *)(prev ? ubi_slNext(prev) : ubi_slFirst(&change_notify_queue)); + continue; + } + + prev = cnbp; + cnbp = (change_notify_buf *)ubi_slNext(cnbp); + } +} + +/**************************************************************************** Process the change notify queue. Note that this is only called as root. *****************************************************************************/ |