xref: /titanic_53/usr/src/head/prof_attr.h (revision 499fd60129a966ad9d9e752e65f591c3a6a1c697)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*499fd601Sgww  * Common Development and Distribution License (the "License").
6*499fd601Sgww  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*499fd601Sgww  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_PROF_ATTR_H
277c478bd9Sstevel@tonic-gate #define	_PROF_ATTR_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate #include <secdb.h>
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #define	PROFATTR_FILENAME		"/etc/security/prof_attr"
417c478bd9Sstevel@tonic-gate #define	PROFATTR_DB_NAME		"prof_attr.org_dir"
427c478bd9Sstevel@tonic-gate #define	PROFATTR_DB_NCOL		5	/* total columns */
437c478bd9Sstevel@tonic-gate #define	PROFATTR_DB_NKEYCOL		1	/* total searchable columns */
447c478bd9Sstevel@tonic-gate #define	PROFATTR_DB_TBLT		"prof_attr_tbl"
457c478bd9Sstevel@tonic-gate #define	PROFATTR_NAME_DEFAULT_KW	"nobody"
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #define	PROFATTR_COL0_KW		"name"
487c478bd9Sstevel@tonic-gate #define	PROFATTR_COL1_KW		"res1"
497c478bd9Sstevel@tonic-gate #define	PROFATTR_COL2_KW		"res2"
507c478bd9Sstevel@tonic-gate #define	PROFATTR_COL3_KW		"desc"
517c478bd9Sstevel@tonic-gate #define	PROFATTR_COL4_KW		"attr"
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #define	DEF_PROF			"PROFS_GRANTED="
54*499fd601Sgww #define	DEF_CONSUSER			"CONSOLE_USER="
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate #define	MAXPROFS			4096
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * indices of searchable columns
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #define	PROFATTR_KEYCOL0		0	/* name */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /*
657c478bd9Sstevel@tonic-gate  * Key words used in the prof_attr database
667c478bd9Sstevel@tonic-gate  */
677c478bd9Sstevel@tonic-gate #define	PROFATTR_AUTHS_KW		"auths"
687c478bd9Sstevel@tonic-gate #define	PROFATTR_PROFS_KW		"profiles"
697c478bd9Sstevel@tonic-gate #define	PROFATTR_PRIVS_KW		"privs"
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * Nsswitch representation of profile attributes.
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate typedef struct profstr_s {
777c478bd9Sstevel@tonic-gate 	char   *name;	/* proforization name */
787c478bd9Sstevel@tonic-gate 	char   *res1;	/* RESERVED */
797c478bd9Sstevel@tonic-gate 	char   *res2;	/* RESERVED */
807c478bd9Sstevel@tonic-gate 	char   *desc;	/* description */
817c478bd9Sstevel@tonic-gate 	char   *attr;	/* string of key-value pair attributes */
827c478bd9Sstevel@tonic-gate } profstr_t;
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate typedef struct profattr_s {
857c478bd9Sstevel@tonic-gate 	char   *name;	/* proforization name */
867c478bd9Sstevel@tonic-gate 	char   *res1;	/* RESERVED */
877c478bd9Sstevel@tonic-gate 	char   *res2;	/* RESERVED */
887c478bd9Sstevel@tonic-gate 	char   *desc;	/* description */
897c478bd9Sstevel@tonic-gate 	kva_t  *attr;	/* array of key-value pair attributes */
907c478bd9Sstevel@tonic-gate } profattr_t;
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #ifdef    __STDC__
937c478bd9Sstevel@tonic-gate extern profattr_t *getprofnam(const char *);
947c478bd9Sstevel@tonic-gate extern profattr_t *getprofattr(void);
957c478bd9Sstevel@tonic-gate extern void getproflist(const char *, char **, int *);
967c478bd9Sstevel@tonic-gate extern void setprofattr(void);
977c478bd9Sstevel@tonic-gate extern void endprofattr(void);
987c478bd9Sstevel@tonic-gate extern void free_profattr(profattr_t *);
997c478bd9Sstevel@tonic-gate extern void free_proflist(char **, int);
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate #else				/* not __STDC__ */
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate extern profattr_t *getprofnam();
1047c478bd9Sstevel@tonic-gate extern profattr_t *getprofattr();
1057c478bd9Sstevel@tonic-gate extern void getproflist();
1067c478bd9Sstevel@tonic-gate extern int setprofattr();
1077c478bd9Sstevel@tonic-gate extern int endprofattr();
1087c478bd9Sstevel@tonic-gate extern void free_profattr();
1097c478bd9Sstevel@tonic-gate extern void free_proflist();
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate #endif
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate #ifdef __cplusplus
1147c478bd9Sstevel@tonic-gate }
1157c478bd9Sstevel@tonic-gate #endif
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #endif	/* _PROF_ATTR_H */
118