zfs_deleg.h revision 91ebeef555ce7f899b6270a3c2df47b51f7ad59a
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks/*
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * CDDL HEADER START
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks *
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * The contents of this file are subject to the terms of the
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * Common Development and Distribution License (the "License").
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * You may not use this file except in compliance with the License.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks *
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * or http://www.opensolaris.org/os/licensing.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * See the License for the specific language governing permissions
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * and limitations under the License.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks *
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * When distributing Covered Code, include this CDDL HEADER in each
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * If applicable, add the following below this CDDL HEADER, with the
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * fields enclosed by brackets "[]" replaced with your own identifying
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * information: Portions Copyright [yyyy] [name of copyright owner]
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks *
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * CDDL HEADER END
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks */
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks/*
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * Use is subject to license terms.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks */
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#ifndef _ZFS_DELEG_H
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define _ZFS_DELEG_H
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#pragma ident "%Z%%M% %I% %E% SMI"
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#include <sys/fs/zfs.h>
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#ifdef __cplusplus
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksextern "C" {
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#endif
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks/*
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks * Max name length for a delegation attribute
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks */
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_MAX_DELEG_NAME 128
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_DELEG_LOCAL 'l'
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_DELEG_DESCENDENT 'd'
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#define ZFS_DELEG_NA '-'
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksextern char *zfs_deleg_perm_tab[];
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksint zfs_deleg_verify_nvlist(nvlist_t *nvlist);
91ebeef555ce7f899b6270a3c2df47b51f7ad59aahrensvoid zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks char checkflag, void *data);
91ebeef555ce7f899b6270a3c2df47b51f7ad59aahrensconst char *zfs_deleg_canonicalize_perm(const char *perm);
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#ifdef __cplusplus
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks}
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#endif
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks#endif /* _ZFS_DELEG_H */