diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-19 19:57:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:56 -0500 |
commit | 2efabbbf4b97a62247aa080249d3de21f044b1cb (patch) | |
tree | b764c27ff639bf671f076fcca5eac2226f758b8a /source3/smbd/trans2.c | |
parent | 06dd8d28ae1625e201082f0dc7019f753c9afb34 (diff) | |
download | samba-2efabbbf4b97a62247aa080249d3de21f044b1cb.tar.gz samba-2efabbbf4b97a62247aa080249d3de21f044b1cb.tar.xz samba-2efabbbf4b97a62247aa080249d3de21f044b1cb.zip |
r24548: Fix the case-changing renames
This was broken when I changed reply_mv to wrap in a open_file_ntcreate
call, unix_convert on the destination was called twice
(This used to be commit fddc9db91175bdb0b7ac6a636f8bef918bd7c1b4)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 36fb2eee76..53368cd8ef 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -4937,9 +4937,28 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn, pstrcat(base_name, newname); if (fsp) { + SMB_STRUCT_STAT sbuf; + pstring newname_last_component; + + ZERO_STRUCT(sbuf); + + status = unix_convert(conn, newname, False, + newname_last_component, &sbuf); + + /* If an error we expect this to be + * NT_STATUS_OBJECT_PATH_NOT_FOUND */ + + if (!NT_STATUS_IS_OK(status) + && !NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND, + status)) { + return status; + } + DEBUG(10,("smb_file_rename_information: SMB_FILE_RENAME_INFORMATION (fnum %d) %s -> %s\n", fsp->fnum, fsp->fsp_name, base_name )); - status = rename_internals_fsp(conn, fsp, base_name, 0, overwrite); + status = rename_internals_fsp(conn, fsp, base_name, + newname_last_component, 0, + overwrite); } else { DEBUG(10,("smb_file_rename_information: SMB_FILE_RENAME_INFORMATION %s -> %s\n", fname, newname )); |