summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_unlink.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-26 11:11:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:47 -0500
commite767d8d1b2c1e86e48d827f10f1773b0dab8e565 (patch)
tree7881983a13760cfb7e429af2a79cb033d1f88733 /source4/ntvfs/posix/pvfs_unlink.c
parent991588e70cf717fb1e9267defb9b14e949a70230 (diff)
downloadsamba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.tar.gz
samba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.tar.bz2
samba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.zip
r3260: redid the pvfs_dirlist() interface in preparation for a "keep
directory open" implementation, as opposed to the "load the whole directory" interface used now. This will be needed to pass RAW-SEARCH (This used to be commit 692623c6c0a2c6817fddfa77cd1c2525c27145c4)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_unlink.c')
-rw-r--r--source4/ntvfs/posix/pvfs_unlink.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c
index 432481a88a..74614d194a 100644
--- a/source4/ntvfs/posix/pvfs_unlink.c
+++ b/source4/ntvfs/posix/pvfs_unlink.c
@@ -81,6 +81,7 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
uint32_t i, total_deleted=0;
struct pvfs_filename *name;
+ const char *fname;
/* resolve the cifs name to a posix name */
status = pvfs_resolve_name(pvfs, req, unl->in.pattern, 0, &name);
@@ -103,36 +104,34 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
}
/* get list of matching files */
- status = pvfs_list(pvfs, name, dir);
+ status = pvfs_list_start(pvfs, name, dir);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- if (dir->count == 0) {
- return NT_STATUS_NO_SUCH_FILE;
- }
-
- for (i=0;i<dir->count;i++) {
+ status = NT_STATUS_NO_SUCH_FILE;
+ for (i=0;
+ (fname = pvfs_list_next(dir, i));
+ i++) {
/* this seems to be a special case */
if ((unl->in.attrib & FILE_ATTRIBUTE_DIRECTORY) &&
- (strcmp(dir->names[i], ".") == 0 ||
- strcmp(dir->names[i], "..") == 0)) {
+ (strcmp(fname, ".") == 0 ||
+ strcmp(fname, "..") == 0)) {
return NT_STATUS_OBJECT_NAME_INVALID;
}
- status = pvfs_unlink_one(pvfs, req, dir->unix_path,
- dir->names[i], unl->in.attrib);
+ status = pvfs_unlink_one(pvfs, req, dir->unix_path, fname, unl->in.attrib);
if (NT_STATUS_IS_OK(status)) {
total_deleted++;
}
}
- if (total_deleted == 0) {
- return status;
+ if (total_deleted > 0) {
+ status = NT_STATUS_OK;
}
- return NT_STATUS_OK;
+ return status;
}