summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-24 00:06:08 +0000
committerJeremy Allison <jra@samba.org>2004-02-24 00:06:08 +0000
commitb88f446352b27d71a71d61a7151694c468cfe609 (patch)
tree3ab8d4887460f25d73eab7e22471cba0cec9b0b0 /source3/smbd
parent13dd3e60bdf9ea799a1c56ca7467f323922e636d (diff)
downloadsamba-b88f446352b27d71a71d61a7151694c468cfe609.tar.gz
samba-b88f446352b27d71a71d61a7151694c468cfe609.tar.bz2
samba-b88f446352b27d71a71d61a7151694c468cfe609.zip
Added NTrename SMB (0xA5) - how did we miss this.... ?
Jeremy. (This used to be commit dfd7d1c2b7b577a084a94926abfce82c91f20b7e)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c50
-rw-r--r--source3/smbd/process.c2
2 files changed, 51 insertions, 1 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 3127134458..2831f75933 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1489,6 +1489,56 @@ int reply_ntcancel(connection_struct *conn,
}
/****************************************************************************
+ Reply to a NT rename request.
+****************************************************************************/
+
+int reply_ntrename(connection_struct *conn,
+ char *inbuf,char *outbuf,int length,int bufsize)
+{
+ int outsize = 0;
+ pstring name;
+ pstring newname;
+ char *p;
+ NTSTATUS status;
+
+ START_PROFILE(SMBntrename);
+
+ p = smb_buf(inbuf) + 1;
+ p += srvstr_get_path(inbuf, name, p, sizeof(name), STR_TERMINATE,&status);
+ if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBntrename);
+ return ERROR_NT(status);
+ }
+ p++;
+ p += srvstr_get_path(inbuf, newname, p, sizeof(newname), STR_TERMINATE,&status);
+ if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBntrename);
+ return ERROR_NT(status);
+ }
+
+ RESOLVE_DFSPATH(name, conn, inbuf, outbuf);
+ RESOLVE_DFSPATH(newname, conn, inbuf, outbuf);
+
+ DEBUG(3,("reply_ntrename : %s -> %s\n",name,newname));
+
+ status = rename_internals(conn, name, newname, False);
+ if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBntrename);
+ return ERROR_NT(status);
+ }
+
+ /*
+ * Win2k needs a changenotify request response before it will
+ * update after a rename..
+ */
+ process_pending_change_notify_queue((time_t)0);
+ outsize = set_message(outbuf,0,0,True);
+
+ END_PROFILE(SMBntrename);
+ return(outsize);
+}
+
+/****************************************************************************
Reply to an unsolicited SMBNTtranss - just ignore it!
****************************************************************************/
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 5206dc70f8..718d1bb67b 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -521,7 +521,7 @@ static const struct smb_message_struct {
/* 0xa2 */ { "SMBntcreateX", reply_ntcreate_and_X, AS_USER | CAN_IPC | QUEUE_IN_OPLOCK },
/* 0xa3 */ { NULL, NULL, 0 },
/* 0xa4 */ { "SMBntcancel", reply_ntcancel, 0 },
-/* 0xa5 */ { NULL, NULL, 0 },
+/* 0xa5 */ { "SMBntrename", reply_ntrename, AS_USER | NEED_WRITE | QUEUE_IN_OPLOCK },
/* 0xa6 */ { NULL, NULL, 0 },
/* 0xa7 */ { NULL, NULL, 0 },
/* 0xa8 */ { NULL, NULL, 0 },