diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-02-22 09:37:22 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-02-25 08:03:43 +0100 |
commit | 58745900d30cbfa8729ce99e7110cfc5e4a78c2a (patch) | |
tree | 976e0cb0bd847846a1021f1815e3b3df6c47f9b9 /source4/ntvfs | |
parent | 0634c12abb634034fcaf842647c2bc09a92bfd68 (diff) | |
download | samba-58745900d30cbfa8729ce99e7110cfc5e4a78c2a.tar.gz samba-58745900d30cbfa8729ce99e7110cfc5e4a78c2a.tar.bz2 samba-58745900d30cbfa8729ce99e7110cfc5e4a78c2a.zip |
pvfs_unlink: splitup the logic into generic and file specific functions
metze
(This used to be commit 7572afdc2635bdf9afbe1eda3c7498d0b5201db3)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/posix/pvfs_unlink.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/source4/ntvfs/posix/pvfs_unlink.c b/source4/ntvfs/posix/pvfs_unlink.c index 72649e646d..0763a4e48c 100644 --- a/source4/ntvfs/posix/pvfs_unlink.c +++ b/source4/ntvfs/posix/pvfs_unlink.c @@ -51,27 +51,13 @@ static NTSTATUS pvfs_unlink_stream(struct pvfs_state *pvfs, /* - unlink one file + unlink a file */ -static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, - struct ntvfs_request *req, - union smb_unlink *unl, - struct pvfs_filename *name) +static NTSTATUS pvfs_unlink_file(struct pvfs_state *pvfs, + 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; - } - if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) { return NT_STATUS_FILE_IS_A_DIRECTORY; } @@ -99,6 +85,31 @@ static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs, } /* + unlink one file +*/ +static NTSTATUS pvfs_unlink_one(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_unlink_file(pvfs, name); +} + +/* delete a file - the dirtype specifies the file types to include in the search. The name can contain CIFS wildcards, but rarely does (except with OS/2 clients) */ |