diff options
author | Jeremy Allison <jra@samba.org> | 2007-02-09 02:03:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:51 -0500 |
commit | 86e5659abac9938e7ac0cea989ca33e807b3e181 (patch) | |
tree | 0f40cf6be9480356660189e83ad6009579178d8c /source3/locking | |
parent | 5920d870cfc6be3c5bbc65ab63a6e63d1d7286f4 (diff) | |
download | samba-86e5659abac9938e7ac0cea989ca33e807b3e181.tar.gz samba-86e5659abac9938e7ac0cea989ca33e807b3e181.tar.bz2 samba-86e5659abac9938e7ac0cea989ca33e807b3e181.zip |
r21257: Better fix for bug #4188 :
Windows Vista RC1 and RC2 can't delete directory on Samba share
based on work by Joe Meadows <jmeadows@webopolis.com>.
Jeremy.
(This used to be commit 2dab8928769938ab79da7b7ce2d165fc388f9b00)
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 39cc991b5f..ffac43aff5 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -1151,42 +1151,7 @@ NTSTATUS can_set_delete_on_close(files_struct *fsp, BOOL delete_on_close, /* Don't allow delete on close for non-empty directories. */ if (fsp->is_directory) { - long offset = 0; - NTSTATUS status; - SMB_STRUCT_STAT st; - struct dptr_struct *dirptr; - const char *name; - - status = dptr_create(fsp->conn, - fsp->fsp_name, - False, - True, - 0, - "*", - True, - 0, - &dirptr); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* Read 3 entries. Ignore first 2 (they're . and .. ) */ - name = dptr_ReadDirName(dirptr, &offset, &st); - if (!name) { - dptr_CloseDir(dirptr); - return NT_STATUS_ACCESS_DENIED; - } - name = dptr_ReadDirName(dirptr, &offset, &st); - if (!name) { - dptr_CloseDir(dirptr); - return NT_STATUS_ACCESS_DENIED; - } - name = dptr_ReadDirName(dirptr, &offset, &st); - dptr_CloseDir(dirptr); - if (name) { - DEBUG(10,("can_set_delete_on_close: got name %s - can't delete\n", name )); - return NT_STATUS_DIRECTORY_NOT_EMPTY; - } + return can_delete_directory(fsp->conn, fsp->fsp_name); } return NT_STATUS_OK; |