}
static int audit_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
struct smb_filename *full_fname_src = NULL;
struct smb_filename *full_fname_dst = NULL;
int saved_errno = 0;
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- smb_fname_src);
+ src_dirfsp,
+ smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
return -1;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- smb_fname_dst);
+ dst_dirfsp,
+ smb_fname_dst);
if (full_fname_dst == NULL) {
TALLOC_FREE(full_fname_src);
errno = ENOMEM;
return -1;
}
result = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
if (result == -1) {
saved_errno = errno;
}
}
static int cap_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
+ files_struct *src_dirfsp,
const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
+ files_struct *dst_dirfsp,
const struct smb_filename *smb_fname_dst,
const struct vfs_rename_how *how)
{
int saved_errno = 0;
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- smb_fname_src);
+ src_dirfsp,
+ smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
goto out;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- smb_fname_dst);
+ dst_dirfsp,
+ smb_fname_dst);
if (full_fname_dst == NULL) {
errno = ENOMEM;
goto out;
smb_fname_dst_tmp->base_name = capnew;
ret = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp->conn->cwd_fsp,
- smb_fname_src_tmp,
- dstfsp->conn->cwd_fsp,
- smb_fname_dst_tmp,
- how);
+ src_dirfsp->conn->cwd_fsp,
+ smb_fname_src_tmp,
+ dst_dirfsp->conn->cwd_fsp,
+ smb_fname_dst_tmp,
+ how);
out:
}
static int cap_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
struct smb_filename *old_full_fname = NULL;
struct smb_filename *new_full_fname = NULL;
/* Process 'old' name. */
old_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- old_smb_fname);
- if (old_full_fname == NULL) {
+ src_dirfsp,
+ old_smb_fname);
+ if (old_full_fname == NULL) {
goto nomem_out;
}
capold = capencode(talloc_tos(), old_full_fname->base_name);
/* Process 'new' name. */
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
- if (new_full_fname == NULL) {
+ dst_dirfsp,
+ new_smb_fname);
+ if (new_full_fname == NULL) {
goto nomem_out;
}
capnew = capencode(talloc_tos(), new_full_fname->base_name);
}
static int catia_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
TALLOC_CTX *ctx = talloc_tos();
struct smb_filename *smb_fname_src_tmp = NULL;
smb_fname_str_dbg(smb_fname_dst_tmp)));
ret = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src_tmp,
- dstfsp,
- smb_fname_dst_tmp,
- how);
+ src_dirfsp,
+ smb_fname_src_tmp,
+ dst_dirfsp,
+ smb_fname_dst_tmp,
+ how);
out:
TALLOC_FREE(src_name_mapped);
}
static int cephwrap_renameat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
struct smb_filename *full_fname_src = NULL;
struct smb_filename *full_fname_dst = NULL;
}
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- smb_fname_src);
+ src_dirfsp,
+ smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
return -1;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- smb_fname_dst);
+ dst_dirfsp,
+ smb_fname_dst);
if (full_fname_dst == NULL) {
TALLOC_FREE(full_fname_src);
errno = ENOMEM;
}
static int cephwrap_linkat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
struct smb_filename *full_fname_old = NULL;
struct smb_filename *full_fname_new = NULL;
int result = -1;
full_fname_old = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- old_smb_fname);
+ src_dirfsp,
+ old_smb_fname);
if (full_fname_old == NULL) {
return -1;
}
full_fname_new = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
+ dst_dirfsp,
+ new_smb_fname);
if (full_fname_new == NULL) {
TALLOC_FREE(full_fname_old);
return -1;
}
static int vfs_ceph_renameat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
struct vfs_ceph_fh *src_dircfh = NULL;
struct vfs_ceph_fh *dst_dircfh = NULL;
START_PROFILE_X(SNUM(handle->conn), syscall_renameat);
DBG_DEBUG("[CEPH] renameat: srcfsp = %p src_name = %s "
"dstfsp = %p dst_name = %s\n",
- srcfsp,
+ src_dirfsp,
smb_fname_src->base_name,
- dstfsp,
+ dst_dirfsp,
smb_fname_dst->base_name);
if (smb_fname_src->stream_name || smb_fname_dst->stream_name) {
goto out;
}
- result = vfs_ceph_fetch_fh(handle, srcfsp, &src_dircfh);
+ result = vfs_ceph_fetch_fh(handle, src_dirfsp, &src_dircfh);
if (result != 0) {
DBG_DEBUG("[CEPH] failed to fetch file handle: srcfsp = %p "
"src_name = %s\n",
- srcfsp, smb_fname_src->base_name);
+ src_dirfsp,
+ smb_fname_src->base_name);
goto out;
}
- result = vfs_ceph_fetch_fh(handle, dstfsp, &dst_dircfh);
+ result = vfs_ceph_fetch_fh(handle, dst_dirfsp, &dst_dircfh);
if (result != 0) {
DBG_DEBUG("[CEPH] failed to fetch file handle: dstfsp = %p "
"dst_name = %s\n",
- dstfsp, smb_fname_dst->base_name);
+ dst_dirfsp,
+ smb_fname_dst->base_name);
goto out;
}
}
static int vfs_ceph_linkat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
+ files_struct *src_dirfsp,
const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
+ files_struct *dst_dirfsp,
const struct smb_filename *new_smb_fname,
int flags)
{
DBG_DEBUG("[CEPH] link(%p, %s, %s)\n", handle, name, newname);
- result = vfs_ceph_fetch_fh(handle, srcfsp, &src_dircfh);
+ result = vfs_ceph_fetch_fh(handle, src_dirfsp, &src_dircfh);
if (result != 0) {
goto out;
}
- result = vfs_ceph_fetch_fh(handle, dstfsp, &dst_dircfh);
+ result = vfs_ceph_fetch_fh(handle, dst_dirfsp, &dst_dircfh);
if (result != 0) {
goto out;
}
}
static int ceph_snap_gmt_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int ret;
time_t timestamp_src, timestamp_dst;
return -1;
}
return SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
/* block links from writeable shares to snapshots for now, like other modules */
}
static int ceph_snap_gmt_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
+ files_struct *src_dirfsp,
const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
+ files_struct *dst_dirfsp,
const struct smb_filename *new_smb_fname,
int flags)
{
return -1;
}
return SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
}
static int ceph_snap_gmt_stat(vfs_handle_struct *handle,
}
static int crossrename_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int result = -1;
}
result = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
+ src_dirfsp,
smb_fname_src,
- dstfsp,
+ dst_dirfsp,
smb_fname_dst,
how);
if ((result == -1) && (errno == EXDEV)) {
/* Rename across filesystems needed. */
NTSTATUS status = copy_reg(handle,
- srcfsp,
+ src_dirfsp,
smb_fname_src,
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
result = 0;
if (!NT_STATUS_IS_OK(status)) {
}
static int vfswrap_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int result = -1;
int flags = 0;
flags |= RENAME_NOREPLACE;
}
- result = renameat2(fsp_get_pathref_fd(srcfsp),
+ result = renameat2(fsp_get_pathref_fd(src_dirfsp),
smb_fname_src->base_name,
- fsp_get_pathref_fd(dstfsp),
+ fsp_get_pathref_fd(dst_dirfsp),
smb_fname_dst->base_name,
flags);
}
static int vfswrap_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
int result;
SMB_ASSERT(!is_named_stream(old_smb_fname));
SMB_ASSERT(!is_named_stream(new_smb_fname));
- result = linkat(fsp_get_pathref_fd(srcfsp),
+ result = linkat(fsp_get_pathref_fd(src_dirfsp),
old_smb_fname->base_name,
- fsp_get_pathref_fd(dstfsp),
+ fsp_get_pathref_fd(dst_dirfsp),
new_smb_fname->base_name,
flags);
}
static int audit_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
struct smb_filename *full_fname_src = NULL;
struct smb_filename *full_fname_dst = NULL;
int saved_errno = 0;
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_fname_dst == NULL) {
TALLOC_FREE(full_fname_src);
}
result = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
if (result == -1) {
saved_errno = errno;
}
}
static int fruit_renameat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int rc = -1;
struct fruit_config_data *config = NULL;
}
rc = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
if (rc != 0) {
return -1;
}
smb_fname_str_dbg(dst_adp_smb_fname));
rc = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- src_adp_smb_fname,
- dstfsp,
- dst_adp_smb_fname,
- how);
+ src_dirfsp,
+ src_adp_smb_fname,
+ dst_dirfsp,
+ dst_adp_smb_fname,
+ how);
if (errno == ENOENT) {
rc = 0;
}
}
static int smb_full_audit_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int result;
int saved_errno;
struct smb_filename *full_fname_dst = NULL;
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
return -1;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_fname_dst == NULL) {
TALLOC_FREE(full_fname_src);
}
result = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
if (result == -1) {
saved_errno = errno;
}
static int smb_full_audit_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
struct smb_filename *old_full_fname = NULL;
struct smb_filename *new_full_fname = NULL;
int result;
old_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- old_smb_fname);
+ src_dirfsp,
+ old_smb_fname);
if (old_full_fname == NULL) {
return -1;
}
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
+ dst_dirfsp,
+ new_smb_fname);
if (new_full_fname == NULL) {
TALLOC_FREE(old_full_fname);
return -1;
}
result = SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
do_log(SMB_VFS_OP_LINKAT,
(result >= 0),
}
static int vfs_gluster_renameat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int ret;
return -1;
}
- src_pglfd = vfs_gluster_fetch_glfd(handle, srcfsp);
+ src_pglfd = vfs_gluster_fetch_glfd(handle, src_dirfsp);
if (src_pglfd == NULL) {
END_PROFILE(syscall_renameat);
DBG_ERR("Failed to fetch gluster fd\n");
return -1;
}
- dst_pglfd = vfs_gluster_fetch_glfd(handle, dstfsp);
+ dst_pglfd = vfs_gluster_fetch_glfd(handle, dst_dirfsp);
if (dst_pglfd == NULL) {
END_PROFILE(syscall_renameat);
DBG_ERR("Failed to fetch gluster fd\n");
}
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_fname_src == NULL) {
END_PROFILE(syscall_renameat);
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_fname_dst == NULL) {
END_PROFILE(syscall_renameat);
}
static int vfs_gluster_linkat(struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
int ret;
START_PROFILE(syscall_linkat);
- src_pglfd = vfs_gluster_fetch_glfd(handle, srcfsp);
+ src_pglfd = vfs_gluster_fetch_glfd(handle, src_dirfsp);
if (src_pglfd == NULL) {
END_PROFILE(syscall_linkat);
DBG_ERR("Failed to fetch gluster fd\n");
return -1;
}
- dst_pglfd = vfs_gluster_fetch_glfd(handle, dstfsp);
+ dst_pglfd = vfs_gluster_fetch_glfd(handle, dst_dirfsp);
if (dst_pglfd == NULL) {
END_PROFILE(syscall_linkat);
DBG_ERR("Failed to fetch gluster fd\n");
START_PROFILE(syscall_linkat);
full_fname_old = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
old_smb_fname);
if (full_fname_old == NULL) {
END_PROFILE(syscall_linkat);
}
full_fname_new = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
new_smb_fname);
if (full_fname_new == NULL) {
END_PROFILE(syscall_linkat);
* Failure: set errno, return -1
*/
static int mh_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int status = -1;
struct smb_filename *full_fname_src = NULL;
!is_in_media_files(smb_fname_dst->base_name))
{
status = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
goto out;
}
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
goto out;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_fname_dst == NULL) {
errno = ENOMEM;
}
status = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp->conn->cwd_fsp,
- srcClientFname,
- dstfsp->conn->cwd_fsp,
- dstClientFname,
- how);
+ src_dirfsp->conn->cwd_fsp,
+ srcClientFname,
+ dst_dirfsp->conn->cwd_fsp,
+ dstClientFname,
+ how);
err:
TALLOC_FREE(full_fname_src);
TALLOC_FREE(full_fname_dst);
* Failure: set errno, return -1
*/
static int mh_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
int status;
struct smb_filename *old_full_fname = NULL;
DEBUG(MH_INFO_DEBUG, ("Entering mh_linkat\n"));
old_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- old_smb_fname);
+ src_dirfsp,
+ old_smb_fname);
if (old_full_fname == NULL) {
status = -1;
goto err;
}
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
+ dst_dirfsp,
+ new_smb_fname);
if (new_full_fname == NULL) {
status = -1;
goto err;
TALLOC_FREE(new_full_fname);
status = SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
goto out;
}
_PUBLIC_
int vfs_not_implemented_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
+ files_struct *src_dirfsp,
const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
+ files_struct *dst_dirfsp,
const struct smb_filename *smb_fname_dst,
const struct vfs_rename_how *how)
{
_PUBLIC_
int vfs_not_implemented_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
errno = ENOSYS;
return -1;
}
static int shadow_copy2_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
time_t timestamp_src = 0;
time_t timestamp_dst = 0;
return -1;
}
return SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
static int shadow_copy2_symlinkat(vfs_handle_struct *handle,
}
static int shadow_copy2_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
time_t timestamp_old = 0;
time_t timestamp_new = 0;
return -1;
}
return SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
}
static int shadow_copy2_stat(vfs_handle_struct *handle,
}
static int snapper_gmt_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
time_t timestamp_src, timestamp_dst;
return -1;
}
return SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
static int snapper_gmt_symlinkat(vfs_handle_struct *handle,
}
static int snapper_gmt_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
time_t timestamp_old = 0;
time_t timestamp_new = 0;
return -1;
}
return SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
}
static int snapper_gmt_fstatat(struct vfs_handle_struct *handle,
}
static int streams_xattr_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
struct streams_xattr_config *config = NULL;
NTSTATUS status;
if (!src_is_stream && !dst_is_stream) {
return SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
if (how->flags != 0) {
}
full_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_src == NULL) {
errno = ENOMEM;
goto fail;
}
full_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_dst == NULL) {
errno = ENOMEM;
renameat needs special handling, as we may need to fsync two directories
*/
static int syncops_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int ret;
return -1);
ret = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
if (ret == -1) {
return ret;
}
}
full_fname_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_fname_src == NULL) {
errno = ENOMEM;
return ret;
}
full_fname_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_fname_dst == NULL) {
TALLOC_FREE(full_fname_src);
}
static int syncops_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
int ret;
struct syncops_config_data *config;
return -1);
ret = SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
if (ret == -1) {
return ret;
}
old_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
old_smb_fname);
if (old_full_fname == NULL) {
return ret;
}
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
new_smb_fname);
if (new_full_fname == NULL) {
TALLOC_FREE(old_full_fname);
}
static int smb_time_audit_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *oldname,
- files_struct *dstfsp,
- const struct smb_filename *newname,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *oldname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *newname,
+ const struct vfs_rename_how *how)
{
int result;
struct timespec ts1,ts2;
struct smb_filename *new_full_fname = NULL;
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- newname);
+ dst_dirfsp,
+ newname);
if (new_full_fname == NULL) {
errno = ENOMEM;
return -1;
}
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- oldname,
- dstfsp,
- newname,
- how);
+ result = SMB_VFS_NEXT_RENAMEAT(
+ handle, src_dirfsp, oldname, dst_dirfsp, newname, how);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
}
static int smb_time_audit_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
struct smb_filename *new_full_fname = NULL;
int result;
double timediff;
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
+ dst_dirfsp,
+ new_smb_fname);
if (new_full_fname == NULL) {
errno = ENOMEM;
return -1;
clock_gettime_mono(&ts1);
result = SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
}
static int um_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int status;
struct smb_filename *src_full_fname = NULL;
struct smb_filename *dst_client_fname = NULL;
src_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- smb_fname_src);
+ src_dirfsp,
+ smb_fname_src);
if (src_full_fname == NULL) {
errno = ENOMEM;
return -1;
}
dst_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- smb_fname_dst);
+ dst_dirfsp,
+ smb_fname_dst);
if (dst_full_fname == NULL) {
TALLOC_FREE(src_full_fname);
errno = ENOMEM;
TALLOC_FREE(src_full_fname);
TALLOC_FREE(dst_full_fname);
return SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
status = alloc_get_client_smb_fname(handle, talloc_tos(),
}
static int um_linkat(vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *old_smb_fname,
- files_struct *dstfsp,
- const struct smb_filename *new_smb_fname,
- int flags)
+ files_struct *src_dirfsp,
+ const struct smb_filename *old_smb_fname,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *new_smb_fname,
+ int flags)
{
int status;
struct smb_filename *old_full_fname = NULL;
struct smb_filename *new_client_fname = NULL;
old_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
- old_smb_fname);
+ src_dirfsp,
+ old_smb_fname);
if (old_full_fname == NULL) {
return -1;
}
new_full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
- new_smb_fname);
+ dst_dirfsp,
+ new_smb_fname);
if (new_full_fname == NULL) {
TALLOC_FREE(old_full_fname);
return -1;
TALLOC_FREE(old_full_fname);
TALLOC_FREE(new_full_fname);
return SMB_VFS_NEXT_LINKAT(handle,
- srcfsp,
- old_smb_fname,
- dstfsp,
- new_smb_fname,
- flags);
+ src_dirfsp,
+ old_smb_fname,
+ dst_dirfsp,
+ new_smb_fname,
+ flags);
}
status = alloc_get_client_smb_fname(handle, talloc_tos(),
return 0;
}
-static int virusfilter_vfs_renameat(
- struct vfs_handle_struct *handle,
- files_struct *srcfsp,
- const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
- const struct smb_filename *smb_fname_dst,
- const struct vfs_rename_how *how)
+static int virusfilter_vfs_renameat(struct vfs_handle_struct *handle,
+ files_struct *src_dirfsp,
+ const struct smb_filename *smb_fname_src,
+ files_struct *dst_dirfsp,
+ const struct smb_filename *smb_fname_dst,
+ const struct vfs_rename_how *how)
{
int ret = SMB_VFS_NEXT_RENAMEAT(handle,
- srcfsp,
- smb_fname_src,
- dstfsp,
- smb_fname_dst,
- how);
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
struct virusfilter_config *config = NULL;
char *fname = NULL;
char *dst_fname = NULL;
}
full_src = full_path_from_dirfsp_atname(talloc_tos(),
- srcfsp,
+ src_dirfsp,
smb_fname_src);
if (full_src == NULL) {
errno = ENOMEM;
}
full_dst = full_path_from_dirfsp_atname(talloc_tos(),
- dstfsp,
+ dst_dirfsp,
smb_fname_dst);
if (full_dst == NULL) {
errno = ENOMEM;
}
static int vfs_worm_renameat(vfs_handle_struct *handle,
- files_struct *srcfsp,
+ files_struct *src_dirfsp,
const struct smb_filename *smb_fname_src,
- files_struct *dstfsp,
+ files_struct *dst_dirfsp,
const struct smb_filename *smb_fname_dst,
const struct vfs_rename_how *how)
{
return -1;
}
- return SMB_VFS_NEXT_RENAMEAT(
- handle, srcfsp, smb_fname_src, dstfsp, smb_fname_dst, how);
+ return SMB_VFS_NEXT_RENAMEAT(handle,
+ src_dirfsp,
+ smb_fname_src,
+ dst_dirfsp,
+ smb_fname_dst,
+ how);
}
static int vfs_worm_fsetxattr(struct vfs_handle_struct *handle,