diff options
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r-- | source3/modules/vfs_default.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index cd792aba32..9a55456b0c 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -520,17 +520,28 @@ static int copy_reg(const char *source, const char *dest) return -1; } -static int vfswrap_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) +static int vfswrap_rename(vfs_handle_struct *handle, + const struct smb_filename *smb_fname_src, + const struct smb_filename *smb_fname_dst) { int result; START_PROFILE(syscall_rename); - result = rename(oldname, newname); + + if (smb_fname_src->stream_name || smb_fname_dst->stream_name) { + errno = ENOENT; + result = -1; + goto out; + } + + result = rename(smb_fname_src->base_name, smb_fname_dst->base_name); if ((result == -1) && (errno == EXDEV)) { /* Rename across filesystems needed. */ - result = copy_reg(oldname, newname); + result = copy_reg(smb_fname_src->base_name, + smb_fname_dst->base_name); } + out: END_PROFILE(syscall_rename); return result; } |