summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_netatalk.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_netatalk.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_netatalk.c')
-rw-r--r--source3/modules/vfs_netatalk.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c
index 0e20beca41..7710772174 100644
--- a/source3/modules/vfs_netatalk.c
+++ b/source3/modules/vfs_netatalk.c
@@ -254,24 +254,29 @@ static int atalk_rename(struct vfs_handle_struct *handle,
atalk_unlink_file(adbl_path);
exit_rename:
+ TALLOC_FREE(oldname);
TALLOC_FREE(adbl_path);
TALLOC_FREE(orig_path);
- TALLOC_FREE(orig_path);
return ret;
}
-static int atalk_unlink(struct vfs_handle_struct *handle, const char *path)
+static int atalk_unlink(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
int ret = 0, i;
- char *adbl_path = 0;
- char *orig_path = 0;
+ char *path = NULL;
+ char *adbl_path = NULL;
+ char *orig_path = NULL;
SMB_STRUCT_STAT adbl_info;
SMB_STRUCT_STAT orig_info;
- TALLOC_CTX *ctx;
+ NTSTATUS status;
- ret = SMB_VFS_NEXT_UNLINK(handle, path);
+ ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
- if (!path) return ret;
+ status = get_full_smb_filename(talloc_tos(), smb_fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ return ret;
+ }
/* no .AppleDouble sync if veto or hide list is empty,
* otherwise "Cannot find the specified file" error will be caused
@@ -292,15 +297,13 @@ static int atalk_unlink(struct vfs_handle_struct *handle, const char *path)
else {
DEBUG(3, ("ATALK: %s is not hidden, skipped..\n",
APPLEDOUBLE));
- return ret;
+ goto exit_unlink;
}
}
}
- if (!(ctx = talloc_init("unlink_file")))
- return ret;
-
- if (atalk_build_paths(ctx, handle->conn->origpath, path, &adbl_path, &orig_path,
+ if (atalk_build_paths(talloc_tos(), handle->conn->origpath, path,
+ &adbl_path, &orig_path,
&adbl_info, &orig_info) != 0)
goto exit_unlink;
@@ -311,8 +314,10 @@ static int atalk_unlink(struct vfs_handle_struct *handle, const char *path)
atalk_unlink_file(adbl_path);
-exit_unlink:
- talloc_destroy(ctx);
+exit_unlink:
+ TALLOC_FREE(path);
+ TALLOC_FREE(adbl_path);
+ TALLOC_FREE(orig_path);
return ret;
}