summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-22 09:41:41 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-25 08:03:44 +0100
commit599901c139e99dca26f267439c14119e6c3f2092 (patch)
treec9210b7dedad8a6a9bb90b57364a6be6d1199648
parent58745900d30cbfa8729ce99e7110cfc5e4a78c2a (diff)
downloadsamba-599901c139e99dca26f267439c14119e6c3f2092.tar.gz
samba-599901c139e99dca26f267439c14119e6c3f2092.tar.bz2
samba-599901c139e99dca26f267439c14119e6c3f2092.zip
pvfs_unlink: move stream logic into pvfs_unlink_one()
metze (This used to be commit 438032e12f3040fbb58488ca537e4d8da39b6124)
-rw-r--r--source4/ntvfs/posix/pvfs_unlink.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c
index 0763a4e48c..bda4014bee 100644
--- a/source4/ntvfs/posix/pvfs_unlink.c
+++ b/source4/ntvfs/posix/pvfs_unlink.c
@@ -25,32 +25,6 @@
/*
- unlink a stream
- */
-static NTSTATUS pvfs_unlink_stream(struct pvfs_state *pvfs,
- struct ntvfs_request *req,
- union smb_unlink *unl,
- struct pvfs_filename *name)
-{
- NTSTATUS status;
-
- /* make sure its matches the given attributes */
- status = pvfs_match_attrib(pvfs, name,
- unl->unlink.in.attrib, 0);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- status = pvfs_can_delete(pvfs, req, name, NULL);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- return pvfs_stream_delete(pvfs, name, -1);
-}
-
-
-/*
unlink a file
*/
static NTSTATUS pvfs_unlink_file(struct pvfs_state *pvfs,
@@ -106,6 +80,14 @@ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs,
return status;
}
+ if (name->stream_name) {
+ if (!name->stream_exists) {
+ return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ }
+
+ return pvfs_stream_delete(pvfs, name, -1);
+ }
+
return pvfs_unlink_file(pvfs, name);
}
@@ -141,14 +123,6 @@ NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
return NT_STATUS_FILE_IS_A_DIRECTORY;
}
- if (name->stream_name) {
- if (!name->stream_exists) {
- return NT_STATUS_OBJECT_NAME_NOT_FOUND;
- }
-
- return pvfs_unlink_stream(pvfs, req, unl, name);
- }
-
if (!name->has_wildcard) {
return pvfs_unlink_one(pvfs, req, unl, name);
}