summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-11 19:28:34 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-11 20:16:51 +0100
commit903ea3d36d8f5c63dabfc23d768450ee0b01dcdc (patch)
tree5489d0c0ce63dddafad9e29add4865f4d63063e5 /source4/smb_server
parentebe8a8985c88dd8e80794d84015e0ab439c6e6af (diff)
downloadsamba-903ea3d36d8f5c63dabfc23d768450ee0b01dcdc.tar.gz
samba-903ea3d36d8f5c63dabfc23d768450ee0b01dcdc.tar.bz2
samba-903ea3d36d8f5c63dabfc23d768450ee0b01dcdc.zip
smb_server: pass down RAW_RENAME_NTTRANS to the ntvfs layer
metze (This used to be commit 80711c03e0e8fba6f80261facd939ef00e06c7fd)
Diffstat (limited to 'source4/smb_server')
-rw-r--r--source4/smb_server/smb/nttrans.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c
index a20c41ba4d..1b49e23511 100644
--- a/source4/smb_server/smb/nttrans.c
+++ b/source4/smb_server/smb/nttrans.c
@@ -287,7 +287,30 @@ static NTSTATUS nttrans_set_sec_desc(struct smbsrv_request *req,
static NTSTATUS nttrans_rename(struct smbsrv_request *req,
struct nttrans_op *op)
{
- return NT_STATUS_NOT_IMPLEMENTED;
+ struct smb_nttrans *trans = op->trans;
+ union smb_rename *io;
+
+ if (trans->in.params.length < 5) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ /* parse the request */
+ io = talloc(req, union smb_rename);
+ NT_STATUS_HAVE_NO_MEMORY(io);
+
+ io->nttrans.level = RAW_RENAME_NTTRANS;
+ io->nttrans.in.file.ntvfs = smbsrv_pull_fnum(req, trans->in.params.data, 0);
+ io->nttrans.in.flags = SVAL(trans->in.params.data, 2);
+
+ smbsrv_blob_pull_string(&req->in.bufinfo, &trans->in.params, 4,
+ &io->nttrans.in.new_name,
+ STR_TERMINATE);
+ if (!io->nttrans.in.new_name) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ SMBSRV_CHECK_FILE_HANDLE_NTSTATUS(io->nttrans.in.file.ntvfs);
+ return ntvfs_rename(req->ntvfs, io);
}
/*