xref: /onnv-gate/usr/src/head/prof_attr.h (revision 12273:63678502e95e)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
56059Sgww  * Common Development and Distribution License (the "License").
66059Sgww  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12273SCasper.Dik@Sun.COM  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef	_PROF_ATTR_H
260Sstevel@tonic-gate #define	_PROF_ATTR_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifdef	__cplusplus
290Sstevel@tonic-gate extern "C" {
300Sstevel@tonic-gate #endif
310Sstevel@tonic-gate 
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/types.h>
340Sstevel@tonic-gate #include <secdb.h>
350Sstevel@tonic-gate 
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #define	PROFATTR_FILENAME		"/etc/security/prof_attr"
380Sstevel@tonic-gate #define	PROFATTR_DB_NAME		"prof_attr.org_dir"
390Sstevel@tonic-gate #define	PROFATTR_DB_NCOL		5	/* total columns */
400Sstevel@tonic-gate #define	PROFATTR_DB_NKEYCOL		1	/* total searchable columns */
410Sstevel@tonic-gate #define	PROFATTR_DB_TBLT		"prof_attr_tbl"
420Sstevel@tonic-gate #define	PROFATTR_NAME_DEFAULT_KW	"nobody"
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #define	PROFATTR_COL0_KW		"name"
450Sstevel@tonic-gate #define	PROFATTR_COL1_KW		"res1"
460Sstevel@tonic-gate #define	PROFATTR_COL2_KW		"res2"
470Sstevel@tonic-gate #define	PROFATTR_COL3_KW		"desc"
480Sstevel@tonic-gate #define	PROFATTR_COL4_KW		"attr"
490Sstevel@tonic-gate 
50*12273SCasper.Dik@Sun.COM #define	PROFILE_STOP			"Stop"
51*12273SCasper.Dik@Sun.COM 
520Sstevel@tonic-gate #define	DEF_PROF			"PROFS_GRANTED="
536059Sgww #define	DEF_CONSUSER			"CONSOLE_USER="
540Sstevel@tonic-gate 
550Sstevel@tonic-gate #define	MAXPROFS			4096
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /*
580Sstevel@tonic-gate  * indices of searchable columns
590Sstevel@tonic-gate  */
600Sstevel@tonic-gate #define	PROFATTR_KEYCOL0		0	/* name */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * Key words used in the prof_attr database
650Sstevel@tonic-gate  */
660Sstevel@tonic-gate #define	PROFATTR_AUTHS_KW		"auths"
670Sstevel@tonic-gate #define	PROFATTR_PROFS_KW		"profiles"
680Sstevel@tonic-gate #define	PROFATTR_PRIVS_KW		"privs"
690Sstevel@tonic-gate 
700Sstevel@tonic-gate 
710Sstevel@tonic-gate /*
720Sstevel@tonic-gate  * Nsswitch representation of profile attributes.
730Sstevel@tonic-gate  */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate typedef struct profstr_s {
760Sstevel@tonic-gate 	char   *name;	/* proforization name */
770Sstevel@tonic-gate 	char   *res1;	/* RESERVED */
780Sstevel@tonic-gate 	char   *res2;	/* RESERVED */
790Sstevel@tonic-gate 	char   *desc;	/* description */
800Sstevel@tonic-gate 	char   *attr;	/* string of key-value pair attributes */
810Sstevel@tonic-gate } profstr_t;
820Sstevel@tonic-gate 
830Sstevel@tonic-gate typedef struct profattr_s {
840Sstevel@tonic-gate 	char   *name;	/* proforization name */
850Sstevel@tonic-gate 	char   *res1;	/* RESERVED */
860Sstevel@tonic-gate 	char   *res2;	/* RESERVED */
870Sstevel@tonic-gate 	char   *desc;	/* description */
880Sstevel@tonic-gate 	kva_t  *attr;	/* array of key-value pair attributes */
890Sstevel@tonic-gate } profattr_t;
900Sstevel@tonic-gate 
910Sstevel@tonic-gate #ifdef    __STDC__
920Sstevel@tonic-gate extern profattr_t *getprofnam(const char *);
930Sstevel@tonic-gate extern profattr_t *getprofattr(void);
940Sstevel@tonic-gate extern void getproflist(const char *, char **, int *);
950Sstevel@tonic-gate extern void setprofattr(void);
960Sstevel@tonic-gate extern void endprofattr(void);
970Sstevel@tonic-gate extern void free_profattr(profattr_t *);
980Sstevel@tonic-gate extern void free_proflist(char **, int);
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate #else				/* not __STDC__ */
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate extern profattr_t *getprofnam();
1030Sstevel@tonic-gate extern profattr_t *getprofattr();
1040Sstevel@tonic-gate extern void getproflist();
1050Sstevel@tonic-gate extern int setprofattr();
1060Sstevel@tonic-gate extern int endprofattr();
1070Sstevel@tonic-gate extern void free_profattr();
1080Sstevel@tonic-gate extern void free_proflist();
1090Sstevel@tonic-gate 
1100Sstevel@tonic-gate #endif
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #ifdef __cplusplus
1130Sstevel@tonic-gate }
1140Sstevel@tonic-gate #endif
1150Sstevel@tonic-gate 
1160Sstevel@tonic-gate #endif	/* _PROF_ATTR_H */
117