The Samba-Bugzilla – Attachment 2263 Details for
Bug 4188
Windows Vista RC1 and RC2 can't delete directory on Samba share
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Prevents setting delete_on_close on non-empty directory
dir_delete.patch (text/plain), 1.91 KB, created by
Joe Meadows
on 2007-02-01 14:00:56 UTC
(
hide
)
Description:
Prevents setting delete_on_close on non-empty directory
Filename:
MIME Type:
Creator:
Joe Meadows
Created:
2007-02-01 14:00:56 UTC
Size:
1.91 KB
patch
obsolete
>--- smbd/dir.c 2006-11-14 06:42:12.000000000 -0800 >+++ smbd/dir.c 2007-02-01 11:22:03.000000000 -0800 >@@ -1255,3 +1255,35 @@ > } > return False; > } >+ >+NTSTATUS deleteDirOk(files_struct *fsp) >+{ >+ NTSTATUS status=NT_STATUS_OK; >+ >+ if (fsp && fsp->conn) >+ { >+ struct smb_Dir *dir_hnd = OpenDir(fsp->conn, fsp->fsp_name, NULL, 0); >+ if (dir_hnd != NULL) >+ { >+ const char *dname; >+ SMB_STRUCT_STAT st; >+ long dirpos = 0; >+ while ((dname = ReadDirName(dir_hnd,&dirpos))) >+ { >+ if ((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0)) >+ continue; >+ if (!is_visible_file(fsp->conn, fsp->fsp_name, dname, &st, False)) >+ continue; >+ if (!IS_VETO_PATH(fsp->conn, dname)) >+ { >+ status = NT_STATUS_DIRECTORY_NOT_EMPTY; >+ break; >+ } >+ } >+ } >+ CloseDir(dir_hnd); >+ } >+ >+ return status; >+} >+ >--- locking/locking.c 2006-07-10 09:27:52.000000000 -0700 >+++ /root/jam/locking.c 2007-02-01 11:21:53.000000000 -0800 >@@ -1118,6 +1118,8 @@ > return True; > } > >+extern NTSTATUS deleteDirOk(files_struct *fsp); >+ > /**************************************************************************** > Deal with the internal needs of setting the delete on close flag. Note that > as the tdb locking is recursive, it is safe to call this from within >@@ -1166,6 +1168,19 @@ > return NT_STATUS_ACCESS_DENIED; > } > >+ if (fsp->is_directory) >+ { >+ if (delete_on_close) >+ { >+ NTSTATUS dirStatus=deleteDirOk(fsp); >+ if (!NT_STATUS_IS_OK(dirStatus)) >+ { >+ DEBUG(5, ("can_set_delete_on_close: ERROR directory '%s' not empty\n",fsp->fsp_name)); >+ return dirStatus; >+ } >+ } >+ } >+ > return NT_STATUS_OK; > } >
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 4188
:
2190
|
2191
|
2250
| 2263 |
2280