usr/src/cmd/allocate/allocate.h
author paulson
Sun, 15 Jan 2006 08:23:20 -0800
changeset 1269 f33c74eed274
parent 0 68f95e015346
child 1676 37f4a3e2bd99
permissions -rw-r--r--
6244980 deallocate(1) has a program usage error 6245008 list_devices(1) and allocate(1) don't give any errors when more than one device entry is specified 6250898 allocate -s is not always silent and 'list_devices -s' error is confusing 6251504 'allocate -F sr0 -g rmt', 'allocate -g sr -F -U', 'allocate -g sr -F' all succeed with no errors 6253496 list_devices allows multiple l,n,u options, does not return an error, and performs only one option 6260923 deallocate has problems following the man page usage [or the man page usage is incorrect] 6308874 'list_devices -U <user-ID>' doesn't work as it treats the user-ID as a username

/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_ALLOCATE_H
#define	_ALLOCATE_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

/* Option Flags */
#define	SILENT		0001	/* -s */
#define	USERID		0002	/* -U <uid> for list_devices(1) */
#define	LIST		0004	/* -l */
#define	FREE		0010	/* -n */
#define	CURRENT 	0020	/* -u */
#define	FORCE		0040	/* -F */
#define	FORCE_ALL 	0100	/* -I */
#define	TYPE		0200	/* -g */
#define	USERNAME	0400	/* -U <username> for allocate(1) */

/* Misc. */

#define	ALL	-1

/* Error returns start at 4 */
#define	SYSERROR	4
#define	DACLCK		5
#define	DACACC		6
#define	DEVLST		7
#define	NALLOCU		8
#define	NOTAUTH		9
#define	CNTFRC		10
#define	CNTDEXEC	11
#define	NO_DEVICE	12
#define	DSPMISS		13
#define	ALLOCERR	14
#define	IMPORT_ERR	15
#define	NODAENT		16
#define	NODMAPENT	17
#define	SETACL_PERR	18
#define	CHOWN_PERR	19
#define	ALLOC		20
#define	ALLOC_OTHER	21
#define	NALLOC		22
#define	AUTHERR		23
#define	CLEAN_ERR	24
#define	DEVNAME_ERR	25
#define	DEVNAME_TOOLONG	26

/* Tunable Parameters */
#define	DEV_DIR		"/dev"
#define	DAC_DIR		"/etc/security/dev"
#define	SECLIB		"/etc/security/lib"
#define	ALLOC_MODE	0600
#define	DEALLOC_MODE    0000
#define	ALLOC_ERR_MODE  0100
#define	ALLOC_UID	(uid_t)0	/* root */
#define	ALLOC_GID	(gid_t)1	/* other */

/* Functions */
extern int allocate(int optflg, uid_t uid, char *device);
extern int deallocate(int optflg, uid_t uid, char *device);
extern int list_devices(int optflg, uid_t uid, char *device);

#ifdef	__cplusplus
}
#endif

#endif	/* _ALLOCATE_H */