*/
static NTSTATUS zfs_get_nt_acl_common(TALLOC_CTX *mem_ctx,
const char *name,
- SMB4ACL_T **ppacl)
+ struct SMB4ACL_T **ppacl)
{
int naces, i;
ace_t *acebuf;
- SMB4ACL_T *pacl;
+ struct SMB4ACL_T *pacl;
/* read the number of file aces */
if((naces = acl(name, ACE_GETACLCNT, 0, NULL)) == -1) {
for(i=0; i<naces; i++) {
SMB_ACE4PROP_T aceprop;
- aceprop.aceType = (uint32) acebuf[i].a_type;
- aceprop.aceFlags = (uint32) acebuf[i].a_flags;
- aceprop.aceMask = (uint32) acebuf[i].a_access_mask;
- aceprop.who.id = (uint32) acebuf[i].a_who;
+ aceprop.aceType = (uint32_t) acebuf[i].a_type;
+ aceprop.aceFlags = (uint32_t) acebuf[i].a_flags;
+ aceprop.aceMask = (uint32_t) acebuf[i].a_access_mask;
+ aceprop.who.id = (uint32_t) acebuf[i].a_who;
if(aceprop.aceFlags & ACE_OWNER) {
aceprop.flags = SMB_ACE4_ID_SPECIAL;
}
/* call-back function processing the NT acl -> ZFS acl using NFSv4 conv. */
-static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp, SMB4ACL_T *smbacl)
+static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp,
+ struct SMB4ACL_T *smbacl)
{
int naces = smb_get_naces(smbacl), i;
ace_t *acebuf;
- SMB4ACE_T *smbace;
+ struct SMB4ACE_T *smbace;
TALLOC_CTX *mem_ctx;
bool have_special_id = false;
acebuf[i].a_flags |= ACE_OWNER;
break;
case SMB_ACE4_WHO_GROUP:
- acebuf[i].a_flags |= ACE_GROUP;
+ acebuf[i].a_flags |= ACE_GROUP|ACE_IDENTIFIER_GROUP;
break;
default:
DEBUG(8, ("unsupported special_id %d\n", \
* using the NFSv4 format conversion
*/
static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
- uint32 security_info_sent,
+ uint32_t security_info_sent,
const struct security_descriptor *psd)
{
- return smb_set_nt_acl_nfs4(handle, fsp, security_info_sent, psd,
+ return smb_set_nt_acl_nfs4(handle, fsp, NULL, security_info_sent, psd,
zfs_process_smbacl);
}
static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
struct files_struct *fsp,
- uint32 security_info,
+ uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
{
- SMB4ACL_T *pacl;
+ struct SMB4ACL_T *pacl;
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
return status;
}
- status = smb_fget_nt_acl_nfs4(fsp, security_info, mem_ctx, ppdesc, pacl);
+ status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, mem_ctx,
+ ppdesc, pacl);
TALLOC_FREE(frame);
return status;
}
static NTSTATUS zfsacl_get_nt_acl(struct vfs_handle_struct *handle,
- const char *name, uint32 security_info,
- TALLOC_CTX *mem_ctx,
- struct security_descriptor **ppdesc)
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
{
- SMB4ACL_T *pacl;
+ struct SMB4ACL_T *pacl;
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
- status = zfs_get_nt_acl_common(frame, name, &pacl);
+ status = zfs_get_nt_acl_common(frame,
+ smb_fname->base_name,
+ &pacl);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(frame);
return status;
}
- status = smb_get_nt_acl_nfs4(handle->conn, name, security_info,
- mem_ctx, ppdesc,
- pacl);
+ status = smb_get_nt_acl_nfs4(handle->conn,
+ smb_fname,
+ NULL,
+ security_info,
+ mem_ctx,
+ ppdesc,
+ pacl);
TALLOC_FREE(frame);
return status;
}
static NTSTATUS zfsacl_fset_nt_acl(vfs_handle_struct *handle,
files_struct *fsp,
- uint32 security_info_sent,
+ uint32_t security_info_sent,
const struct security_descriptor *psd)
{
return zfs_set_nt_acl(handle, fsp, security_info_sent, psd);
}
static int zfsacl_fail__sys_acl_delete_def_file(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
return -1;
}
.fset_nt_acl_fn = zfsacl_fset_nt_acl,
};
-NTSTATUS vfs_zfsacl_init(void);
-NTSTATUS vfs_zfsacl_init(void)
+NTSTATUS vfs_zfsacl_init(TALLOC_CTX *);
+NTSTATUS vfs_zfsacl_init(TALLOC_CTX *ctx)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "zfsacl",
&zfsacl_fns);