dmake: remove '-->' outputs.
[unleashed/lotheac.git] / include / auth_attr.h
blob32be62f9d21951624a348debd7c52ca18beeaa88
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright (c) 1999 by Sun Microsystems, Inc. All rights reserved.
27 #ifndef _AUTH_ATTR_H
28 #define _AUTH_ATTR_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include <sys/types.h>
35 #include <secdb.h>
38 * Some macros used internally by the nsswitch code
40 #define AUTH_MMAPLEN 1024
41 #define AUTH_POLICY "/etc/security/policy.conf"
42 #define DEF_AUTH "AUTHS_GRANTED="
43 #define AUTHATTR_FILENAME "/etc/security/auth_attr"
44 #define AUTHATTR_DB_NAME "auth_attr.org_dir"
45 #define AUTHATTR_DB_NCOL 6 /* total columns */
46 #define AUTHATTR_DB_NKEYCOL 1 /* total searchable columns */
47 #define AUTHATTR_DB_TBLT "auth_attr_tbl"
48 #define AUTHATTR_NAME_DEFAULT_KW "nobody"
50 #define AUTHATTR_COL0_KW "name"
51 #define AUTHATTR_COL1_KW "res1"
52 #define AUTHATTR_COL2_KW "res2"
53 #define AUTHATTR_COL3_KW "short_desc"
54 #define AUTHATTR_COL4_KW "long_desc"
55 #define AUTHATTR_COL5_KW "attr"
58 * indices of searchable columns
60 #define AUTHATTR_KEYCOL0 0 /* name */
64 * Key words used in the auth_attr database
66 #define AUTHATTR_HELP_KW "help"
69 * Nsswitch internal representation of authorization attributes.
71 typedef struct authstr_s {
72 char *name; /* authorization name */
73 char *res1; /* reserved for future use */
74 char *res2; /* reserved for future use */
75 char *short_desc; /* short description */
76 char *long_desc; /* long description */
77 char *attr; /* string of key-value pair attributes */
78 } authstr_t;
81 * API representation of authorization attributes.
83 typedef struct authattr_s {
84 char *name; /* authorization name */
85 char *res1; /* reserved for future use */
86 char *res2; /* reserved for future use */
87 char *short_desc; /* short description */
88 char *long_desc; /* long description */
89 kva_t *attr; /* array of key-value pair attributes */
90 } authattr_t;
92 extern authattr_t *getauthnam(const char *);
93 extern authattr_t *getauthattr(void);
94 extern void setauthattr(void);
95 extern void endauthattr(void);
96 extern void free_authattr(authattr_t *);
97 extern int chkauthattr(const char *, const char *);
99 #ifdef __cplusplus
101 #endif
103 #endif /* _AUTH_ATTR_H */