}
static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p, TALLOC_CTX *mem_ctx,
- char **blob_description, DATA_BLOB *blob)
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
errno = ENOSYS;
return -1;
}
static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p, TALLOC_CTX *mem_ctx,
- char **blob_description, DATA_BLOB *blob)
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
- return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx,
+ return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx,
blob_description, blob);
}
to const struct smb_filename * */
/* Version 37 - Change sys_acl_get_file from const char *
to const struct smb_filename * */
+/* Version 37 - Change sys_acl_blob_get_file from const char *
+ to const struct smb_filename * */
#define SMB_VFS_INTERFACE_VERSION 37
struct files_struct *fsp,
TALLOC_CTX *mem_ctx);
int (*sys_acl_blob_get_file_fn)(struct vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
char **blob_description,
DATA_BLOB *blob);
struct files_struct *fsp,
TALLOC_CTX *mem_ctx);
int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
char **blob_description,
DATA_BLOB *blob);
#define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx) \
smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (mem_ctx))
-#define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, path_p, mem_ctx, blob_description, blob) \
- smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (path_p), (mem_ctx), (blob_description), (blob))
-#define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob) \
- smb_vfs_call_sys_acl_blob_get_file((handle)->next, (path_p), (mem_ctx), (blob_description), (blob))
+#define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, smb_fname, mem_ctx, blob_description, blob) \
+ smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (smb_fname), (mem_ctx), (blob_description), (blob))
+#define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname, mem_ctx, blob_description, blob) \
+ smb_vfs_call_sys_acl_blob_get_file((handle)->next, (smb_fname), (mem_ctx), (blob_description), (blob))
#define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob) \
smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob))
#include "modules/non_posix_acls.h"
int non_posix_sys_acl_blob_get_file_helper(vfs_handle_struct *handle,
- const char *path_p,
- DATA_BLOB acl_as_blob,
- TALLOC_CTX *mem_ctx,
- DATA_BLOB *blob)
+ const struct smb_filename *smb_fname_in,
+ DATA_BLOB acl_as_blob,
+ TALLOC_CTX *mem_ctx,
+ DATA_BLOB *blob)
{
int ret;
TALLOC_CTX *frame = talloc_stackframe();
struct xattr_sys_acl_hash_wrapper acl_wrapper = {};
- struct smb_filename *smb_fname;
+ struct smb_filename *smb_fname = cp_smb_filename_nostream(frame,
+ smb_fname_in);
- smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
- errno = ENOMEM;
return -1;
}
*/
int non_posix_sys_acl_blob_get_file_helper(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
DATA_BLOB acl_as_blob,
TALLOC_CTX *mem_ctx,
DATA_BLOB *blob);
} else {
/* Get the full underlying sd, then hash. */
ret = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle,
- smb_fname->base_name,
+ smb_fname,
mem_ctx,
&sys_acl_blob_description,
&sys_acl_blob);
}
/* We don't have a linear form of the AFS ACL yet */
-static int afsacl_sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+static int afsacl_sys_acl_blob_get_file(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
errno = ENOSYS;
return -1;
pacl);
}
-static int aixjfs2_sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+static int aixjfs2_sys_acl_blob_get_file(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
struct SMB4ACL_T *pacl = NULL;
+ const char *path_p = smb_fname->base_name;
bool result;
bool retryPosix = False;
result = aixjfs2_get_nfs4_acl(mem_ctx, path_p, &pacl, &retryPosix);
if (retryPosix)
{
- return posix_sys_acl_blob_get_file(handle, path_p, mem_ctx,
+ return posix_sys_acl_blob_get_file(handle, smb_fname, mem_ctx,
blob_description, blob);
}
/* Now way to linarlise NFS4 ACLs at the moment, but the NT ACL is pretty close in this case */
}
static int smb_full_audit_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p,
- TALLOC_CTX *mem_ctx,
- char **blob_description,
- DATA_BLOB *blob)
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
int result;
- result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob);
+ result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname,
+ mem_ctx, blob_description, blob);
do_log(SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE, (result >= 0), handle,
- "%s", path_p);
+ "%s", smb_fname->base_name);
return result;
}
}
static int gpfsacl_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
char **blob_description,
DATA_BLOB *blob)
struct gpfs_opaque_acl *acl = NULL;
DATA_BLOB aclblob;
int result;
+ const char *path_p = smb_fname->base_name;
SMB_VFS_HANDLE_GET_DATA(handle, config,
struct gpfs_config_data,
return -1);
if (!config->acl) {
- return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p,
+ return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname,
mem_ctx,
blob_description,
blob);
return -1;
}
- result = non_posix_sys_acl_blob_get_file_helper(handle, path_p,
+ result = non_posix_sys_acl_blob_get_file_helper(handle, smb_fname,
aclblob,
mem_ctx, blob);
}
/* fall back to POSIX ACL */
- return posix_sys_acl_blob_get_file(handle, path_p, mem_ctx,
+ return posix_sys_acl_blob_get_file(handle, smb_fname, mem_ctx,
blob_description, blob);
}
return -1;
}
-static int nfs4acl_xattr_fail__sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+static int nfs4acl_xattr_fail__sys_acl_blob_get_file(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
return -1;
}
static int smb_time_audit_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p,
- TALLOC_CTX *mem_ctx,
- char **blob_description,
- DATA_BLOB *blob)
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob);
+ result = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, smb_fname,
+ mem_ctx, blob_description, blob);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
return -1;
}
-static int zfsacl_fail__sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob)
+static int zfsacl_fail__sys_acl_blob_get_file(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
return -1;
}
}
int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname_in,
TALLOC_CTX *mem_ctx,
char **blob_description,
DATA_BLOB *blob)
struct smb_acl_wrapper acl_wrapper = {
NULL
};
- struct smb_filename *smb_fname;
-
- smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
+ struct smb_filename *smb_fname = cp_smb_filename_nostream(frame,
+ smb_fname_in);
if (smb_fname == NULL) {
TALLOC_FREE(frame);
errno = ENOMEM;
/* This ensures that we also consider the default ACL */
if (fsp->is_directory || fsp->fh->fd == -1) {
- return posix_sys_acl_blob_get_file(handle, fsp->fsp_name->base_name,
- mem_ctx, blob_description, blob);
+ return posix_sys_acl_blob_get_file(handle,
+ fsp->fsp_name,
+ mem_ctx,
+ blob_description,
+ blob);
}
frame = talloc_stackframe();
uint32_t security_info_wanted,
struct security_descriptor **sd);
int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
char **blob_description,
DATA_BLOB *blob);
}
int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle,
- const char *path_p,
- TALLOC_CTX *mem_ctx,
- char **blob_description,
- DATA_BLOB *blob)
+ const struct smb_filename *smb_fname,
+ TALLOC_CTX *mem_ctx,
+ char **blob_description,
+ DATA_BLOB *blob)
{
VFS_FIND(sys_acl_blob_get_file);
- return handle->fns->sys_acl_blob_get_file_fn(handle, path_p, mem_ctx, blob_description, blob);
+ return handle->fns->sys_acl_blob_get_file_fn(handle, smb_fname,
+ mem_ctx, blob_description, blob);
}
int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle,
DATA_BLOB blob;
int ret;
size_t i;
+ struct smb_filename *smb_fname = NULL;
if (argc != 2) {
printf("Usage: sys_acl_get_file <path>\n");
return NT_STATUS_OK;
}
- ret = SMB_VFS_SYS_ACL_BLOB_GET_FILE(vfs->conn, argv[1], talloc_tos(),
+ smb_fname = synthetic_smb_fname_split(talloc_tos(),
+ argv[1],
+ lp_posix_pathnames());
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ ret = SMB_VFS_SYS_ACL_BLOB_GET_FILE(vfs->conn, smb_fname, talloc_tos(),
&description, &blob);
if (ret != 0) {
printf("sys_acl_blob_get_file failed (%s)\n", strerror(errno));