summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-09 09:03:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:59 -0500
commit45e7b954cdf7eb2efc970f01fee452e98aed00ee (patch)
treeca542a2b1e0a8c03e2ab3c8a4baf53869225b461 /source3
parentb5cad2c2a75ee614ec765d8bfb5b1ad9df984f57 (diff)
downloadsamba-45e7b954cdf7eb2efc970f01fee452e98aed00ee.tar.gz
samba-45e7b954cdf7eb2efc970f01fee452e98aed00ee.tar.bz2
samba-45e7b954cdf7eb2efc970f01fee452e98aed00ee.zip
r20628: Looks bigger than it is. This is just re-indenting the if (dirname) that we've
taken care of above. Volker (This used to be commit 5e1da363bb3f2675beb9fd9240301bb432e5239b)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/reply.c78
1 files changed, 38 insertions, 40 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index d50a6e5224..e0f074a7ca 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2031,6 +2031,7 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
} else {
struct smb_Dir *dir_hnd = NULL;
const char *dname;
+ long offset = 0;
if (strequal(mask,"????????.???"))
pstrcpy(mask,"*");
@@ -2048,56 +2049,53 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
We don't implement this yet XXXX
*/
- if (dir_hnd) {
- long offset = 0;
- error = NT_STATUS_NO_SUCH_FILE;
+ error = NT_STATUS_NO_SUCH_FILE;
- while ((dname = ReadDirName(dir_hnd, &offset))) {
- SMB_STRUCT_STAT st;
- pstring fname;
- BOOL sys_direntry = False;
- pstrcpy(fname,dname);
+ while ((dname = ReadDirName(dir_hnd, &offset))) {
+ SMB_STRUCT_STAT st;
+ pstring fname;
+ BOOL sys_direntry = False;
+ pstrcpy(fname,dname);
- if (!is_visible_file(conn, directory, dname, &st, True)) {
- continue;
- }
+ if (!is_visible_file(conn, directory, dname, &st, True)) {
+ continue;
+ }
- /* Quick check for "." and ".." */
- if (fname[0] == '.') {
- if (!fname[1] || (fname[1] == '.' && !fname[2])) {
- if (dirtype & FILE_ATTRIBUTE_DIRECTORY) {
- sys_direntry = True;
- } else {
- continue;
- }
+ /* Quick check for "." and ".." */
+ if (fname[0] == '.') {
+ if (!fname[1] || (fname[1] == '.' && !fname[2])) {
+ if (dirtype & FILE_ATTRIBUTE_DIRECTORY) {
+ sys_direntry = True;
+ } else {
+ continue;
}
}
+ }
- if(!mask_match(fname, mask, conn->case_sensitive))
- continue;
+ if(!mask_match(fname, mask, conn->case_sensitive))
+ continue;
- if (sys_direntry) {
- error = NT_STATUS_OBJECT_NAME_INVALID;
- DEBUG(3,("unlink_internals: system directory delete denied [%s] mask [%s]\n",
- fname, mask));
- break;
- }
+ if (sys_direntry) {
+ error = NT_STATUS_OBJECT_NAME_INVALID;
+ DEBUG(3,("unlink_internals: system directory delete denied [%s] mask [%s]\n",
+ fname, mask));
+ break;
+ }
- slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
- error = can_delete(conn, fname, dirtype);
- if (!NT_STATUS_IS_OK(error)) {
- continue;
- }
- if (SMB_VFS_UNLINK(conn,fname) == 0) {
- count++;
- notify_action(
- conn, directory, dname,
- -1, NOTIFY_ACTION_REMOVED);
- }
- DEBUG(3,("unlink_internals: succesful unlink [%s]\n",fname));
+ slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
+ error = can_delete(conn, fname, dirtype);
+ if (!NT_STATUS_IS_OK(error)) {
+ continue;
}
- CloseDir(dir_hnd);
+ if (SMB_VFS_UNLINK(conn,fname) == 0) {
+ count++;
+ notify_action(
+ conn, directory, dname,
+ -1, NOTIFY_ACTION_REMOVED);
+ }
+ DEBUG(3,("unlink_internals: succesful unlink [%s]\n",fname));
}
+ CloseDir(dir_hnd);
}
if (count == 0 && NT_STATUS_IS_OK(error)) {