summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_xattr_tdb.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-02 09:27:44 -0700
committerTim Prouty <tprouty@samba.org>2009-07-06 15:38:36 -0700
commit258952aa85f2a68e2d2362522f6114c6a439f1e3 (patch)
tree696d8f4425cb6d82c95c0923ba1b0405d39a1f5e /source3/modules/vfs_xattr_tdb.c
parent133e915a81510f543f6458f377857d4f1b680970 (diff)
downloadsamba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.gz
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.bz2
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.zip
s3: Plumb smb_filename through SMB_VFS_UNLINK
Diffstat (limited to 'source3/modules/vfs_xattr_tdb.c')
-rw-r--r--source3/modules/vfs_xattr_tdb.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 39adfdfe15..e805fbcb2c 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -611,27 +611,35 @@ static bool xattr_tdb_init(int snum, struct db_context **p_db)
/*
* On unlink we need to delete the tdb record
*/
-static int xattr_tdb_unlink(vfs_handle_struct *handle, const char *path)
+static int xattr_tdb_unlink(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- SMB_STRUCT_STAT sbuf;
+ struct smb_filename *smb_fname_tmp = NULL;
struct file_id id;
struct db_context *db;
struct db_record *rec;
- int ret;
+ NTSTATUS status;
+ int ret = -1;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
- if (vfs_stat_smb_fname(handle->conn, path, &sbuf) == -1) {
+ status = copy_smb_filename(talloc_tos(), smb_fname, &smb_fname_tmp);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
return -1;
}
- ret = SMB_VFS_NEXT_UNLINK(handle, path);
+ if (SMB_VFS_STAT(handle->conn, smb_fname_tmp) == -1) {
+ goto out;
+ }
+
+ ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname_tmp);
if (ret == -1) {
- return -1;
+ goto out;
}
- id = SMB_VFS_FILE_ID_CREATE(handle->conn, &sbuf);
+ id = SMB_VFS_FILE_ID_CREATE(handle->conn, &smb_fname_tmp->st);
rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);
@@ -644,7 +652,9 @@ static int xattr_tdb_unlink(vfs_handle_struct *handle, const char *path)
TALLOC_FREE(rec);
}
- return 0;
+ out:
+ TALLOC_FREE(smb_fname_tmp);
+ return ret;
}
/*