xref: /titanic_41/usr/src/cmd/nscd/nscd_initf.c (revision 488060a6285c53d78d4e5360e7db00d6d544d960)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #include <nss_common.h>
26 #include <nss_dbdefs.h>
27 #include "nscd_common.h"
28 #include "nscd_switch.h"
29 
30 void
31 _nss_initf_passwd(nss_db_params_t *p)
32 {
33 	p->name	= NSS_DBNAM_PASSWD;
34 	p->default_config = NSS_DEFCONF_PASSWD;
35 }
36 
37 void
38 _nss_initf_hosts(nss_db_params_t *p)
39 {
40 	p->name	= NSS_DBNAM_HOSTS;
41 	p->default_config = NSS_DEFCONF_HOSTS;
42 }
43 
44 void
45 _nss_initf_group(nss_db_params_t *p)
46 {
47 	p->name	= NSS_DBNAM_GROUP;
48 	p->default_config = NSS_DEFCONF_GROUP;
49 }
50 
51 void
52 _nss_initf_ipnodes(nss_db_params_t *p)
53 {
54 	p->name	= NSS_DBNAM_IPNODES;
55 	p->default_config = NSS_DEFCONF_IPNODES;
56 }
57 
58 void
59 _nss_initf_net(nss_db_params_t *p)
60 {
61 	p->name	= NSS_DBNAM_NETWORKS;
62 	p->default_config = NSS_DEFCONF_NETWORKS;
63 }
64 
65 void
66 _nss_initf_proto(nss_db_params_t *p)
67 {
68 	p->name	= NSS_DBNAM_PROTOCOLS;
69 	p->default_config = NSS_DEFCONF_PROTOCOLS;
70 }
71 
72 void
73 _nss_initf_rpc(p)
74 	nss_db_params_t	*p;
75 {
76 	p->name	= NSS_DBNAM_RPC;
77 	p->default_config = NSS_DEFCONF_RPC;
78 }
79 
80 void
81 _nss_initf_ethers(nss_db_params_t *p)
82 {
83 	p->name	= NSS_DBNAM_ETHERS;
84 	p->default_config = NSS_DEFCONF_ETHERS;
85 }
86 
87 void
88 _nss_initf_netmasks(nss_db_params_t *p)
89 {
90 	p->name	= NSS_DBNAM_NETMASKS;
91 	p->default_config = NSS_DEFCONF_NETMASKS;
92 }
93 
94 void
95 _nss_initf_bootparams(nss_db_params_t *p)
96 {
97 	p->name	= NSS_DBNAM_BOOTPARAMS;
98 	p->default_config = NSS_DEFCONF_BOOTPARAMS;
99 }
100 
101 void
102 _nss_initf_publickey(nss_db_params_t *p)
103 {
104 	p->name	= NSS_DBNAM_PUBLICKEY;
105 	p->default_config = NSS_DEFCONF_PUBLICKEY;
106 }
107 
108 void
109 _nss_initf_netgroup(nss_db_params_t *p)
110 {
111 	p->name	= NSS_DBNAM_NETGROUP;
112 	p->default_config = NSS_DEFCONF_NETGROUP;
113 }
114 
115 void
116 _nss_initf_services(nss_db_params_t *p)
117 {
118 	p->name	= NSS_DBNAM_SERVICES;
119 	p->default_config = NSS_DEFCONF_SERVICES;
120 }
121 
122 void
123 _nss_initf_printers(nss_db_params_t *p)
124 {
125 	p->name	= NSS_DBNAM_PRINTERS;
126 	p->default_config = NSS_DEFCONF_PRINTERS;
127 }
128 
129 void
130 _nss_initf_authattr(nss_db_params_t *p)
131 {
132 	p->name	= NSS_DBNAM_AUTHATTR;
133 	p->default_config = NSS_DEFCONF_AUTHATTR;
134 }
135 
136 void
137 _nss_initf_profattr(nss_db_params_t *p)
138 {
139 	p->name	= NSS_DBNAM_PROFATTR;
140 	p->default_config = NSS_DEFCONF_PROFATTR;
141 }
142 
143 void
144 _nss_initf_execattr(nss_db_params_t *p)
145 {
146 	p->name	= NSS_DBNAM_EXECATTR;
147 	p->default_config = NSS_DEFCONF_PROFATTR;
148 	p->config_name    = NSS_DBNAM_PROFATTR; /* use config for "prof_attr" */
149 }
150 
151 void
152 _nss_initf_userattr(nss_db_params_t *p)
153 {
154 	p->name	= NSS_DBNAM_USERATTR;
155 	p->config_name = NSS_DBNAM_PASSWD;
156 	p->default_config = NSS_DEFCONF_USERATTR;
157 }
158 
159 void
160 _nss_initf_project(nss_db_params_t *p)
161 {
162 	p->name	= NSS_DBNAM_PROJECT;
163 	p->default_config = NSS_DEFCONF_PROJECT;
164 }
165 
166 void
167 _nss_initf_auuser(nss_db_params_t *p)
168 {
169 	p->name	= NSS_DBNAM_AUDITUSER;
170 	p->config_name	= NSS_DBNAM_PASSWD;
171 	p->default_config = NSS_DEFCONF_AUDITUSER;
172 }
173 
174 void
175 _nss_initf_shadow(nss_db_params_t *p)
176 {
177 	p->name	= NSS_DBNAM_SHADOW;
178 	p->config_name	= NSS_DBNAM_PASSWD;
179 	p->default_config = NSS_DEFCONF_PASSWD;
180 }
181 
182 void
183 _nss_initf_passwd_compat(nss_db_params_t *p)
184 {
185 	p->name	= NSS_DBNAM_PASSWD;
186 	p->config_name	= NSS_DBNAM_PASSWD_COMPAT;
187 	p->default_config = NSS_DEFCONF_PASSWD_COMPAT;
188 }
189 
190 void
191 _nss_initf_group_compat(nss_db_params_t *p)
192 {
193 	p->name	= NSS_DBNAM_GROUP;
194 	p->config_name	= NSS_DBNAM_GROUP_COMPAT;
195 	p->default_config = NSS_DEFCONF_GROUP_COMPAT;
196 }
197 
198 void
199 _nss_initf_tsol_rh(nss_db_params_t *p)
200 {
201 	p->name = NSS_DBNAM_TSOL_RH;
202 	p->default_config = NSS_DEFCONF_TSOL_RH;
203 }
204 
205 void
206 _nss_initf_tsol_tp(nss_db_params_t *p)
207 {
208 	p->name = NSS_DBNAM_TSOL_TP;
209 	p->default_config = NSS_DEFCONF_TSOL_TP;
210 }
211 
212 nss_db_initf_t	nscd_nss_db_initf[] = {
213 	_nss_initf_passwd,
214 	_nss_initf_hosts,
215 	_nss_initf_group,
216 	_nss_initf_ipnodes,
217 	_nss_initf_net,
218 	_nss_initf_proto,
219 	_nss_initf_rpc,
220 	_nss_initf_ethers,
221 	_nss_initf_netmasks,
222 	_nss_initf_bootparams,
223 	_nss_initf_publickey,
224 	_nss_initf_netgroup,
225 	_nss_initf_services,
226 	_nss_initf_printers,
227 	_nss_initf_authattr,
228 	_nss_initf_profattr,
229 	_nss_initf_execattr,
230 	_nss_initf_userattr,
231 	_nss_initf_project,
232 	_nss_initf_shadow,
233 	_nss_initf_auuser,
234 	_nss_initf_tsol_rh,
235 	_nss_initf_tsol_tp,
236 	_nss_initf_passwd_compat,
237 	_nss_initf_group_compat,
238 	/*
239 	 * no initf() for pseudo-databases: passwd, shadow, user_attr,
240 	 * and group (when called from the compat backend)
241 	 */
242 	NULL,
243 	NULL,
244 	NULL,
245 	NULL};
246