The Samba-Bugzilla – Attachment 1547 Details for
Bug 3216
Deleting of folders doesn't work (they reappear after a refresh)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against 3.0.20b
look (text/plain), 3.04 KB, created by
Jeremy Allison
on 2005-10-27 18:08:08 UTC
(
hide
)
Description:
Patch against 3.0.20b
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2005-10-27 18:08:08 UTC
Size:
3.04 KB
patch
obsolete
>diff -u -r ./smbd/close.c /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/close.c >--- ./smbd/close.c 2005-10-12 10:03:24.000000000 -0700 >+++ /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/close.c 2005-10-27 17:52:50.000000000 -0700 >@@ -288,6 +288,10 @@ > > static int close_directory(files_struct *fsp, BOOL normal_close) > { >+ size_t share_entry_count = 0; >+ share_mode_entry *share_entry = NULL; >+ BOOL delete_dir = False; >+ > remove_pending_change_notify_requests_by_fid(fsp); > > /* >@@ -295,8 +299,13 @@ > * reference to a directory also. > */ > >- if (normal_close && >- get_delete_on_close_flag(fsp->dev, fsp->inode)) { >+ lock_share_entry_fsp(fsp); >+ share_entry_count = del_share_mode(fsp, &share_entry, &delete_dir); >+ unlock_share_entry_fsp(fsp); >+ >+ SAFE_FREE(share_entry); >+ >+ if (normal_close && delete_dir) { > BOOL ok = rmdir_internals(fsp->conn, fsp->fsp_name); > DEBUG(5,("close_directory: %s. Delete on close was set - deleting directory %s.\n", > fsp->fsp_name, ok ? "succeeded" : "failed" )); >diff -u -r ./smbd/open.c /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/open.c >--- ./smbd/open.c 2005-10-12 10:03:24.000000000 -0700 >+++ /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/open.c 2005-10-27 17:53:42.000000000 -0700 >@@ -1917,6 +1917,9 @@ > BOOL dir_existed = VALID_STAT(*psbuf) ? True : False; > BOOL create_dir = False; > int info = 0; >+ int num_share_modes = 0; >+ int oplock_request = 0; >+ BOOL dummy = 0; > > DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, " > "share_access = 0x%x create_options = 0x%x, " >@@ -2059,14 +2062,38 @@ > fsp->is_stat = False; > string_set(&fsp->fsp_name,fname); > >+ lock_share_entry(conn, fsp->dev, fsp->inode); >+ >+ num_share_modes = open_mode_check(conn, fname, fsp->dev, fsp->inode, >+ access_mask, share_access, >+ create_options, >+ &oplock_request, >+ &dummy); >+ >+ if(num_share_modes == -1) { >+ unlock_share_entry(conn, fsp->dev, fsp->inode); >+ file_free(fsp); >+ return NULL; >+ } >+ >+ set_share_mode(fsp, 0, NO_OPLOCK); >+ > if (create_options & FILE_DELETE_ON_CLOSE) { > NTSTATUS status = can_set_delete_on_close(fsp, True, 0); > if (!NT_STATUS_IS_OK(status)) { >+ unlock_share_entry(conn, fsp->dev, fsp->inode); >+ file_free(fsp); >+ return NULL; >+ } >+ if (!modify_delete_flag(fsp->dev, fsp->inode, True)) { >+ unlock_share_entry(conn, fsp->dev, fsp->inode); > file_free(fsp); > return NULL; > } > } > >+ unlock_share_entry(conn, fsp->dev, fsp->inode); >+ > /* Change the owner if required. */ > if ((info == FILE_WAS_CREATED) && lp_inherit_owner(SNUM(conn))) { > change_owner_to_parent(conn, fsp, fsp->fsp_name, psbuf); >diff -u -r ./smbd/trans2.c /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/trans2.c >--- ./smbd/trans2.c 2005-10-12 10:03:26.000000000 -0700 >+++ /home/jeremy/tmp/samba-3.0.20b-mod/source/smbd/trans2.c 2005-10-27 17:42:42.000000000 -0700 >@@ -3520,7 +3520,7 @@ > delete_on_close ? "Adding" : "Removing", fsp->fnum, > fsp->fsp_name )); > >- if (fsp->is_directory || fsp->is_stat) >+ if (fsp->is_stat) > return NT_STATUS_OK; > > if (lock_share_entry_fsp(fsp) == False)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 3216
:
1540
| 1547