1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +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

@ -304,15 +304,36 @@ static int cap_unlink(vfs_handle_struct *handle,
return ret;
}
static int cap_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
static int cap_chmod(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode)
{
char *cappath = capencode(talloc_tos(), path);
struct smb_filename *cap_smb_fname = NULL;
char *cappath = capencode(talloc_tos(), smb_fname->base_name);
int ret;
int saved_errno;
if (!cappath) {
errno = ENOMEM;
return -1;
}
return SMB_VFS_NEXT_CHMOD(handle, cappath, mode);
cap_smb_fname = synthetic_smb_fname(talloc_tos(),
cappath,
NULL,
NULL);
if (cap_smb_fname == NULL) {
TALLOC_FREE(cappath);
errno = ENOMEM;
return -1;
}
ret = SMB_VFS_NEXT_CHMOD(handle, cap_smb_fname, mode);
saved_errno = errno;
TALLOC_FREE(cappath);
TALLOC_FREE(cap_smb_fname);
errno = saved_errno;
return ret;
}
static int cap_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid)