Beispiel #1
0
int aixacl_sys_acl_set_fd(vfs_handle_struct *handle,
			    files_struct *fsp,
			    SMB_ACL_T theacl)
{
	struct acl *file_acl = NULL;
	unsigned int rc;

	file_acl = aixacl_smb_to_aixacl(SMB_ACL_TYPE_ACCESS, theacl);
	if (!file_acl)
		return -1;

	rc = fchacl(fsp->fh->fd,file_acl,file_acl->acl_len);
	DEBUG(10,("errno is %d\n",errno));
	DEBUG(10,("return code is %d\n",rc));
	SAFE_FREE(file_acl);
	DEBUG(10,("Exiting aixacl_sys_acl_set_fd\n"));

	return rc;
}
Beispiel #2
0
int aixacl_sys_acl_set_file(vfs_handle_struct *handle,
			      const char *name,
			      SMB_ACL_TYPE_T type,
			      SMB_ACL_T theacl)
{
	struct acl *file_acl = NULL;
	unsigned int rc;
	
	file_acl = aixacl_smb_to_aixacl(type, theacl);
	if (!file_acl)
		return -1;

	rc = chacl((char *)name,file_acl,file_acl->acl_len);
	DEBUG(10,("errno is %d\n",errno));
	DEBUG(10,("return code is %d\n",rc));
	SAFE_FREE(file_acl);
	DEBUG(10,("Exiting the aixacl_sys_acl_set_file\n"));

	return rc;
}
Beispiel #3
0
int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
			    files_struct *fsp,
			    SMB_ACL_T theacl)
{
	struct acl	*acl_aixc;
	acl_type_t	acl_type_info;
	int	rc;

	DEBUG(10, ("aixjfs2_sys_acl_set_fd invoked for %s", fsp_str_dbg(fsp)));

	rc = aixjfs2_query_acl_support(fsp->fsp_name->base_name, ACL_AIXC,
				       &acl_type_info);
	if (rc) {
		DEBUG(8, ("jfs2_set_nt_acl: AIXC support not found\n"));
		return -1;
	}

	acl_aixc = aixacl_smb_to_aixacl(SMB_ACL_TYPE_ACCESS, theacl);
	if (!acl_aixc)
		return -1;

	rc = aclx_fput(
		fsp->fh->fd,
		SET_ACL, /* set only the ACL, not mode bits */
		acl_type_info,
		acl_aixc,
		acl_aixc->acl_len,
		0
	);
	if (rc) {
		DEBUG(2, ("aclx_fput failed with %s for %s\n",
			strerror(errno), fsp_str_dbg(fsp)));
		return -1;
	}

	return 0;
}
Beispiel #4
0
int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
			      const char *name,
			      SMB_ACL_TYPE_T type,
			      SMB_ACL_T theacl)
{
	struct acl	*acl_aixc;
	acl_type_t	acl_type_info;
	int	rc;

	DEBUG(10, ("aixjfs2_sys_acl_set_file invoked for %s", name));

	rc = aixjfs2_query_acl_support((char *)name, ACL_AIXC, &acl_type_info);
	if (rc) {
		DEBUG(8, ("jfs2_set_nt_acl: AIXC support not found\n"));
		return -1;
	}

	acl_aixc = aixacl_smb_to_aixacl(type, theacl);
	if (!acl_aixc)
		return -1;

	rc = aclx_put(
		(char *)name,
		SET_ACL, /* set only the ACL, not mode bits */
		acl_type_info,
		acl_aixc,
		acl_aixc->acl_len,
		0
	);
	if (rc) {
		DEBUG(2, ("aclx_put failed with %s for %s\n",
			strerror(errno), name));
		return -1;
	}

	return 0;
}