diff options
author | Jeremy Allison <jra@samba.org> | 2011-08-18 14:11:45 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-08-19 00:43:04 +0200 |
commit | a6d06c069734cae037105350982545b6a964bbd8 (patch) | |
tree | c3b82668149ff1718fd0050b68b93a95118a7622 /source3/modules | |
parent | 292fe7497134a9cc8f05844951547a2e8d14a4ac (diff) | |
download | samba-a6d06c069734cae037105350982545b6a964bbd8.tar.gz samba-a6d06c069734cae037105350982545b6a964bbd8.tar.bz2 samba-a6d06c069734cae037105350982545b6a964bbd8.zip |
Fix bug #8370 - vfs_chown_fsp broken -- returns in the wrong directory
Ensure we always use vfs_ChDir() to keep the singleton cache coherent.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Aug 19 00:43:05 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_acl_common.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index b01fd18b9b..a4d712f525 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -831,6 +831,13 @@ static int acl_common_remove_object(vfs_handle_struct *handle, const char *final_component = NULL; struct smb_filename local_fname; int saved_errno = 0; + char *saved_dir = NULL; + + saved_dir = vfs_GetWd(talloc_tos(),conn); + if (!saved_dir) { + saved_errno = errno; + goto out; + } if (!parent_dirname(talloc_tos(), path, &parent_dir, &final_component)) { @@ -843,7 +850,7 @@ static int acl_common_remove_object(vfs_handle_struct *handle, parent_dir, final_component )); /* cd into the parent dir to pin it. */ - ret = SMB_VFS_CHDIR(conn, parent_dir); + ret = vfs_ChDir(conn, parent_dir); if (ret == -1) { saved_errno = errno; goto out; @@ -897,7 +904,9 @@ static int acl_common_remove_object(vfs_handle_struct *handle, TALLOC_FREE(parent_dir); - vfs_ChDir(conn, conn->connectpath); + if (saved_dir) { + vfs_ChDir(conn, saved_dir); + } if (saved_errno) { errno = saved_errno; } |