summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-16 16:37:20 -0700
committerJeremy Allison <jra@samba.org>2009-10-16 16:38:59 -0700
commit010dfbf1fd26718ad197e3428ed0b03111f6c9e5 (patch)
treeadc082fb10c9b5ed062c2d7e8612e0cffcca2f93 /source3
parent7655282ede0375a0de4102c2b8f27cf8985bd71c (diff)
downloadsamba-010dfbf1fd26718ad197e3428ed0b03111f6c9e5.tar.gz
samba-010dfbf1fd26718ad197e3428ed0b03111f6c9e5.tar.bz2
samba-010dfbf1fd26718ad197e3428ed0b03111f6c9e5.zip
Fix one missing STAT -> LSTAT with POSIX pathnames in vfs_xattr_tdb.c. Caught by the torture tester. I love unit tests :-). Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_xattr_tdb.c8
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh2
2 files changed, 9 insertions, 1 deletions
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 55fb1417b7..f7fbfce4cb 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -630,9 +630,15 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle,
return -1;
}
- if (SMB_VFS_STAT(handle->conn, smb_fname_tmp) == -1) {
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
+ }
+ if (ret == -1) {
goto out;
}
+
if (smb_fname_tmp->st.st_ex_nlink == 1) {
/* Only remove record on last link to file. */
remove_record = true;
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index b0199a390b..f10bfeac39 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -94,6 +94,7 @@ test_bad_symlink()
cat > $tmpfile <<EOF
posix
+posix_unlink newname
symlink badname newname
posix_unlink newname
quit
@@ -118,6 +119,7 @@ EOF
# got the correct prompt .. succeed
true
else
+ echo "$out"
echo failed create then delete bad symlink
false
fi