/* Directory operations */
-static DIR *atalk_opendir(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
+static DIR *atalk_opendir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ const char *mask,
+ uint32_t attr)
{
DIR *ret = 0;
- ret = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
+ ret = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
/*
* when we try to perform delete operation upon file which has fork
return ret;
}
-static DIR *atalk_fdopendir(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
+static DIR *atalk_fdopendir(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attr)
{
DIR *ret = 0;
return ret;
}
-static int atalk_rmdir(struct vfs_handle_struct *handle, const char *path)
+static int atalk_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
bool add = False;
TALLOC_CTX *ctx = 0;
+ const char *path = smb_fname->base_name;
char *dpath;
- if (!handle->conn->origpath || !path) goto exit_rmdir;
+ if (!handle->conn->cwd || !path) goto exit_rmdir;
/* due to there is no way to change bDeleteVetoFiles variable
* from this module, gotta use talloc stuff..
goto exit_rmdir;
if (!(dpath = talloc_asprintf(ctx, "%s/%s%s",
- handle->conn->origpath, path, add ? "/"APPLEDOUBLE : "")))
+ handle->conn->cwd, path, add ? "/"APPLEDOUBLE : "")))
goto exit_rmdir;
atalk_rrmdir(ctx, dpath);
exit_rmdir:
talloc_destroy(ctx);
- return SMB_VFS_NEXT_RMDIR(handle, path);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
/* File operations */
return ret;
}
- if (atalk_build_paths(talloc_tos(), handle->conn->origpath, oldname,
+ if (atalk_build_paths(talloc_tos(), handle->conn->cwd, oldname,
&adbl_path, &orig_path, &adbl_info,
&orig_info) != 0)
goto exit_rename;
}
}
- if (atalk_build_paths(talloc_tos(), handle->conn->origpath, path,
+ if (atalk_build_paths(talloc_tos(), handle->conn->cwd, path,
&adbl_path, &orig_path,
&adbl_info, &orig_info) != 0)
goto exit_unlink;
return ret;
}
-static int atalk_chmod(struct vfs_handle_struct *handle, const char *path, mode_t mode)
+static int atalk_chmod(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ mode_t mode)
{
int ret = 0;
+ int ret1 = 0;
char *adbl_path = 0;
char *orig_path = 0;
SMB_STRUCT_STAT adbl_info;
SMB_STRUCT_STAT orig_info;
TALLOC_CTX *ctx;
- ret = SMB_VFS_NEXT_CHMOD(handle, path, mode);
-
- if (!path) return ret;
+ ret = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
if (!(ctx = talloc_init("chmod_file")))
return ret;
- if (atalk_build_paths(ctx, handle->conn->origpath, path, &adbl_path,
- &orig_path, &adbl_info, &orig_info) != 0)
+ ret1 = atalk_build_paths(ctx,
+ handle->conn->cwd,
+ smb_fname->base_name,
+ &adbl_path,
+ &orig_path,
+ &adbl_info,
+ &orig_info);
+ if (ret1 != 0) {
goto exit_chmod;
+ }
if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) {
DEBUG(3, ("ATALK: %s has passed..\n", orig_path));
return ret;
}
-static int atalk_chown(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
+static int atalk_chown(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ uid_t uid,
+ gid_t gid)
{
int ret = 0;
char *adbl_path = 0;
SMB_STRUCT_STAT orig_info;
TALLOC_CTX *ctx;
- ret = SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
-
- if (!path) return ret;
+ ret = SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
if (!(ctx = talloc_init("chown_file")))
return ret;
- if (atalk_build_paths(ctx, handle->conn->origpath, path,
+ if (atalk_build_paths(ctx, handle->conn->cwd, smb_fname->base_name,
&adbl_path, &orig_path,
&adbl_info, &orig_info) != 0)
goto exit_chown;
return ret;
}
-static int atalk_lchown(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)
+static int atalk_lchown(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ uid_t uid,
+ gid_t gid)
{
int ret = 0;
char *adbl_path = 0;
SMB_STRUCT_STAT orig_info;
TALLOC_CTX *ctx;
- ret = SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
-
- if (!path) return ret;
+ ret = SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid);
if (!(ctx = talloc_init("lchown_file")))
return ret;
- if (atalk_build_paths(ctx, handle->conn->origpath, path,
+ if (atalk_build_paths(ctx, handle->conn->cwd, smb_fname->base_name,
&adbl_path, &orig_path,
&adbl_info, &orig_info) != 0)
goto exit_lchown;
.lchown_fn = atalk_lchown,
};
-NTSTATUS vfs_netatalk_init(void);
-NTSTATUS vfs_netatalk_init(void)
+NTSTATUS vfs_netatalk_init(TALLOC_CTX *);
+NTSTATUS vfs_netatalk_init(TALLOC_CTX *ctx)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "netatalk",
&vfs_netatalk_fns);