diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-01-09 09:03:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:59 -0500 |
commit | 5e1da363bb3f2675beb9fd9240301bb432e5239b (patch) | |
tree | c4d5537dee376dd14355db2e3b385af258a0c44b /source | |
parent | 614651c6a72742173de5fa8723403880acc37c09 (diff) | |
download | samba-5e1da363bb3f2675beb9fd9240301bb432e5239b.tar.gz samba-5e1da363bb3f2675beb9fd9240301bb432e5239b.tar.xz samba-5e1da363bb3f2675beb9fd9240301bb432e5239b.zip |
r20628: Looks bigger than it is. This is just re-indenting the if (dirname) that we've
taken care of above.
Volker
Diffstat (limited to 'source')
-rw-r--r-- | source/smbd/reply.c | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d50a6e52243..e0f074a7ca5 100644 --- a/source/smbd/reply.c +++ b/source/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)) { |