1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

VFS: Modify chmod to take a const struct smb_filename * instead of const char *

Preparing to reduce use of lp_posix_pathnames().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison
2016-03-01 16:20:25 -08:00
committed by Ralph Boehme
parent d7ca174744
commit ac8fba6ef7
28 changed files with 248 additions and 105 deletions

View File

@ -357,25 +357,33 @@ 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->cwd, 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));