Fix one missing STAT -> LSTAT with POSIX pathnames in vfs_xattr_tdb.c. Caught by...
authorJeremy Allison <jra@samba.org>
Fri, 16 Oct 2009 23:37:20 +0000 (16:37 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 16 Oct 2009 23:38:59 +0000 (16:38 -0700)
source3/modules/vfs_xattr_tdb.c
source3/script/tests/test_smbclient_s3.sh

index 55fb1417b71f35348963c53f7e92c842539f5bce..f7fbfce4cb979f2232d9c301a78faab41996e5b1 100644 (file)
@@ -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;
index b0199a390b089dacc6b053c99c52a7e27524e75f..f10bfeac3946bac03ccb9fafb4c91deb0d5dfb19 100755 (executable)
@@ -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