Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/user_attr.h
+++ new/usr/src/head/user_attr.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
22 23 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
23 24 */
24 25
25 26 #ifndef _USER_ATTR_H
26 27 #define _USER_ATTR_H
27 28
28 29 #ifdef __cplusplus
29 30 extern "C" {
30 31 #endif
31 32
32 33
33 34 #include <sys/types.h>
34 35 #include <secdb.h>
35 36
36 37
37 38 struct __FILE; /* structure tag for type FILE defined in stdio.h */
38 39
39 40 /*
40 41 * Some macros used internally by the nsswitch code
41 42 */
42 43 #define USERATTR_FILENAME "/etc/user_attr"
43 44 #define USERATTR_DB_NAME "user_attr.org_dir"
44 45 #define USERATTR_DB_NCOL 5 /* total columns */
45 46 #define USERATTR_DB_NKEYCOL 2 /* total searchable columns */
46 47 #define USERATTR_DB_TBL "user_attr_tbl"
47 48 #define USERATTR_NAME_DEFAULT_KW "nobody"
48 49
49 50 #define USERATTR_COL0_KW "name"
50 51 #define USERATTR_COL1_KW "qualifier"
51 52 #define USERATTR_COL2_KW "res1"
52 53 #define USERATTR_COL3_KW "res2"
53 54 #define USERATTR_COL4_KW "attr"
54 55
55 56 #define DEF_LIMITPRIV "PRIV_LIMIT="
56 57 #define DEF_DFLTPRIV "PRIV_DEFAULT="
57 58
58 59 /*
59 60 * indices of searchable columns
60 61 */
61 62 #define USERATTR_KEYCOL0 0 /* name */
62 63 #define USERATTR_KEYCOL1 1 /* qualifier */
63 64
64 65 /*
65 66 * Key words used in the user_attr database
66 67 */
67 68 #define USERATTR_LOCK_KW "lock"
68 69 #define USERATTR_LOCK_LOCKED_KW "locked"
69 70 #define USERATTR_LOCK_OPEN_KW "open"
70 71 #define USERATTR_LOCK_FIXED_KW "fixed"
71 72 #define USERATTR_GEN_KW "gen"
72 73 #define USERATTR_GEN_AUTOMATIC_KW "automatic"
73 74 #define USERATTR_GEN_MANUAL_KW "manual"
74 75 #define USERATTR_GEN_SYSDEF_KW "sysdef"
75 76 #define USERATTR_PROFILES_KW "profiles"
76 77 #define USERATTR_PROFILES_NONE_KW "none"
77 78 #define USERATTR_ROLES_KW "roles"
78 79 #define USERATTR_ROLES_NONE_KW "none"
79 80 #define USERATTR_DEFAULTPROJ_KW "project"
80 81 #define USERATTR_IDLETIME_KW "idletime"
81 82 #define USERATTR_IDLECMD_KW "idlecmd"
82 83 #define USERATTR_IDLECMD_LOCK_KW "lock"
83 84 #define USERATTR_IDLECMD_LOGOUT_KW "logout"
84 85 #define USERATTR_TYPE_KW "type"
85 86 #define USERATTR_TYPE_NORMAL_KW "normal"
86 87 #define USERATTR_TYPE_ADMIN_KW "admin"
87 88 #define USERATTR_TYPE_NONADMIN_KW "role"
88 89 #define USERATTR_AUTHS_KW "auths"
89 90 #define USERATTR_LIMPRIV_KW "limitpriv"
90 91 #define USERATTR_DFLTPRIV_KW "defaultpriv"
91 92 #define USERATTR_LOCK_AFTER_RETRIES_KW "lock_after_retries"
92 93 #define USERATTR_CLEARANCE "clearance"
93 94 #define USERATTR_LABELVIEW "labelview"
94 95 #define USERATTR_LABELVIEW_EXTERNAL "external"
95 96 #define USERATTR_LABELVIEW_HIDESL "hidesl"
96 97 #define USERATTR_HIDESL USERATTR_LABELVIEW_HIDESL
97 98 #define USERATTR_LABELVIEW_INTERNAL "internal"
98 99 #define USERATTR_LABELVIEW_SHOWSL "showsl"
99 100 #define USERATTR_LABELTRANS "labeltrans"
100 101 #define USERATTR_LOCK_NO "no"
101 102 #define USERATTR_LOCK_YES "yes"
102 103 #define USERATTR_MINLABEL "min_label"
103 104 #define USERATTR_PASSWD "password"
104 105 #define USERATTR_PASSWD_AUTOMATIC "automatic"
105 106 #define USERATTR_PASSWD_MANUAL "manual"
106 107 #define USERATTR_TYPE_ROLE USERATTR_TYPE_NONADMIN_KW
107 108 #define USERATTR_AUDIT_FLAGS_KW "audit_flags"
108 109
109 110
110 111 /*
111 112 * Nsswitch representation of user attributes.
112 113 */
113 114 typedef struct userstr_s {
114 115 char *name; /* user name */
115 116 char *qualifier; /* reserved for future use */
116 117 char *res1; /* reserved for future use */
117 118 char *res2; /* reserved for future use */
118 119 char *attr; /* string of key-value pair attributes */
119 120 } userstr_t;
120 121
121 122 /*
↓ open down ↓ |
90 lines elided |
↑ open up ↑ |
122 123 * API representation of user attributes.
123 124 */
124 125 typedef struct userattr_s {
125 126 char *name; /* user name */
126 127 char *qualifier; /* reserved for future use */
127 128 char *res1; /* reserved for future use */
128 129 char *res2; /* reserved for future use */
129 130 kva_t *attr; /* array of key-value pair attributes */
130 131 } userattr_t;
131 132
132 -#ifdef __STDC__
133 133 extern userattr_t *getusernam(const char *);
134 134 extern userattr_t *getuseruid(uid_t uid);
135 135 extern userattr_t *getuserattr(void);
136 136 extern userattr_t *fgetuserattr(struct __FILE *);
137 137 extern void setuserattr(void);
138 138 extern void enduserattr(void);
139 139 extern void free_userattr(userattr_t *);
140 140
141 -#else /* not __STDC__ */
142 -
143 -extern userattr_t *getusernam();
144 -extern userattr_t *getuseruid();
145 -extern userattr_t *getuserattr();
146 -extern userattr_t *fgetuserattr();
147 -extern void setuserattr();
148 -extern void enduserattr();
149 -extern void free_userattr();
150 -#endif
151 -
152 141 #ifdef __cplusplus
153 142 }
154 143 #endif
155 144
156 145 #endif /* _USER_ATTR_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX