summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-08-12 16:27:17 -0700
committerJeremy Allison <jra@samba.org>2009-08-12 16:27:17 -0700
commitd91edeaa94c54a190a0c90bbd63156fdf670c26a (patch)
tree302d6a097f1dd4d123b4041f0b1c9636e7eba114
parent6a0c2946be947afbb56acbf6444d4a2b48cc06f4 (diff)
downloadsamba-d91edeaa94c54a190a0c90bbd63156fdf670c26a.tar.gz
samba-d91edeaa94c54a190a0c90bbd63156fdf670c26a.tar.bz2
samba-d91edeaa94c54a190a0c90bbd63156fdf670c26a.zip
When mapping EA's into a TDB, don't remove the EA
until the last link to the file is gone (fixes the build farm RAW-RENAME test with xattr's in tdb's). Jeremy.
-rw-r--r--source3/modules/vfs_xattr_tdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index a058c824e7..55fb1417b7 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -620,6 +620,7 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle,
struct db_record *rec;
NTSTATUS status;
int ret = -1;
+ bool remove_record = false;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
@@ -632,6 +633,10 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle,
if (SMB_VFS_STAT(handle->conn, smb_fname_tmp) == -1) {
goto out;
}
+ if (smb_fname_tmp->st.st_ex_nlink == 1) {
+ /* Only remove record on last link to file. */
+ remove_record = true;
+ }
ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname_tmp);
@@ -639,6 +644,10 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle,
goto out;
}
+ if (!remove_record) {
+ goto out;
+ }
+
id = SMB_VFS_FILE_ID_CREATE(handle->conn, &smb_fname_tmp->st);
rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);