diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-09-04 07:13:01 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-09-04 07:13:01 +0000 |
commit | 19fea3242cf6234786b6cbb60631e0071f31ff9f (patch) | |
tree | 1de6e79890a80a1e03cf0dce5813513aaf51bc59 /source3/smbd/nttrans.c | |
parent | 55cf37488f66eba2826dba08e80dd4ab6df33fc3 (diff) | |
download | samba-19fea3242cf6234786b6cbb60631e0071f31ff9f.tar.gz samba-19fea3242cf6234786b6cbb60631e0071f31ff9f.tar.bz2 samba-19fea3242cf6234786b6cbb60631e0071f31ff9f.zip |
the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 8a70e69365..aee5aa7798 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1435,37 +1435,35 @@ static int call_nt_transact_rename(connection_struct *conn, int bufsize, char **ppsetup, char **ppparams, char **ppdata) { - char *params = *ppparams; - pstring new_name; - files_struct *fsp = file_fsp(params, 0); - BOOL replace_if_exists = (SVAL(params,2) & RENAME_REPLACE_IF_EXISTS) ? True : False; - int outsize = 0; - - CHECK_FSP(fsp, conn); - srvstr_pull(inbuf, new_name, params+4, sizeof(new_name), -1, STR_TERMINATE); - - outsize = rename_internals(conn, inbuf, outbuf, fsp->fsp_name, - new_name, replace_if_exists); - if(outsize == 0) { - /* - * Rename was successful. - */ - send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL, 0); + char *params = *ppparams; + pstring new_name; + files_struct *fsp = file_fsp(params, 0); + BOOL replace_if_exists = (SVAL(params,2) & RENAME_REPLACE_IF_EXISTS) ? True : False; + NTSTATUS status; - DEBUG(3,("nt transact rename from = %s, to = %s succeeded.\n", - fsp->fsp_name, new_name)); + CHECK_FSP(fsp, conn); + srvstr_pull(inbuf, new_name, params+4, sizeof(new_name), -1, STR_TERMINATE); - outsize = -1; + status = rename_internals(conn, fsp->fsp_name, + new_name, replace_if_exists); + if (!NT_STATUS_IS_OK(status)) return ERROR_NT(status); /* + * Rename was successful. + */ + send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL, 0); + + DEBUG(3,("nt transact rename from = %s, to = %s succeeded.\n", + fsp->fsp_name, new_name)); + + /* * Win2k needs a changenotify request response before it will * update after a rename.. */ - + process_pending_change_notify_queue((time_t)0); - } - return(outsize); + return -1; } |