{
pstring directory;
pstring mask;
- pstring orig_name;
char *p;
int count=0;
NTSTATUS error = NT_STATUS_OK;
: NT_STATUS_OBJECT_PATH_NOT_FOUND;
}
- /*
- * Feel my pain, this code needs rewriting *very* badly! -- vl
- */
- pstrcpy(orig_name, name);
-
p = strrchr_m(name,'/');
if (!p) {
pstrcpy(directory,".");
if (SMB_VFS_UNLINK(conn,directory) == 0) {
count++;
- notify_fname(conn, orig_name, -1,
+ notify_fname(conn, directory, -1,
NOTIFY_ACTION_REMOVED);
}
if (strequal(mask,"????????.???"))
pstrcpy(mask,"*");
- if (check_name(directory,conn))
- dir_hnd = OpenDir(conn, directory, mask, dirtype);
+ if (!check_name(directory,conn)) {
+ return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
+
+ if (!(dir_hnd = OpenDir(conn, directory, mask, dirtype))) {
+ return NT_STATUS_NO_SUCH_FILE;
+ }
/* XXXX the CIFS spec says that if bit0 of the flags2 field is set then
the pattern matches against the long name, otherwise the short name