diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-02-21 20:12:46 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-02-25 08:03:39 +0100 |
commit | 63b15441f4a5f636a079fa5407b2e97a8b99b6e2 (patch) | |
tree | 9b4a5cd3401b2cf83aebd0070e38e42cdc1645f2 | |
parent | 6f077d4017e6df9e070b1c3ea85b7afacf3437cd (diff) | |
download | samba-63b15441f4a5f636a079fa5407b2e97a8b99b6e2.tar.gz samba-63b15441f4a5f636a079fa5407b2e97a8b99b6e2.tar.bz2 samba-63b15441f4a5f636a079fa5407b2e97a8b99b6e2.zip |
pvfs_unlink: pass down a struct pvfs_filename to pvfs_unlink_one()
metze
(This used to be commit 43ec7fa2d898ce306557ea9092b6412bcc2f97ec)
-rw-r--r-- | source4/ntvfs/posix/pvfs_unlink.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c index d6e60b59d3..101dd75de6 100644 --- a/source4/ntvfs/posix/pvfs_unlink.c +++ b/source4/ntvfs/posix/pvfs_unlink.c @@ -58,34 +58,23 @@ static NTSTATUS pvfs_unlink_stream(struct pvfs_state *pvfs, */ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, struct ntvfs_request *req, - const char *unix_path, - const char *fname, uint32_t attrib) + struct pvfs_filename *name, + uint32_t attrib) { - struct pvfs_filename *name; NTSTATUS status; - /* get a pvfs_filename object */ - status = pvfs_resolve_partial(pvfs, req, - unix_path, fname, &name); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - /* make sure its matches the given attributes */ status = pvfs_match_attrib(pvfs, name, attrib, 0); if (!NT_STATUS_IS_OK(status)) { - talloc_free(name); return status; } status = pvfs_can_delete(pvfs, req, name, NULL); if (!NT_STATUS_IS_OK(status)) { - talloc_free(name); return status; } if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) { - talloc_free(name); return NT_STATUS_FILE_IS_A_DIRECTORY; } @@ -108,8 +97,6 @@ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, name->full_name); } - talloc_free(name); - return status; } @@ -156,6 +143,7 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs, } status = NT_STATUS_NO_SUCH_FILE; + talloc_free(name); ofs = 0; @@ -166,10 +154,20 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs, return NT_STATUS_OBJECT_NAME_INVALID; } - status = pvfs_unlink_one(pvfs, req, pvfs_list_unix_path(dir), fname, unl->unlink.in.attrib); + /* get a pvfs_filename object */ + status = pvfs_resolve_partial(pvfs, req, + pvfs_list_unix_path(dir), + fname, &name); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = pvfs_unlink_one(pvfs, req, name, unl->unlink.in.attrib); if (NT_STATUS_IS_OK(status)) { total_deleted++; } + + talloc_free(name); } if (total_deleted > 0) { |