xref: /titanic_41/usr/src/lib/nsswitch/nis/common/getprofattr.c (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1999 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include <sys/types.h>
30 #include <prof_attr.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include "nis_common.h"
34 
35 static nss_status_t
36 getbynam(nis_backend_ptr_t be, void *a)
37 {
38 	nss_XbyY_args_t *argp = (nss_XbyY_args_t *)a;
39 
40 	return (_nss_nis_lookup(be,
41 		argp, 1, NIS_MAP_PROFATTR, argp->key.name, 0));
42 }
43 
44 static nis_backend_op_t profattr_ops[] = {
45 	_nss_nis_destr,
46 	_nss_nis_endent,
47 	_nss_nis_setent,
48 	_nss_nis_getent_netdb,
49 	getbynam
50 };
51 
52 nss_backend_t  *
53 _nss_nis_prof_attr_constr(const char *dummy1,
54     const char *dummy2,
55     const char *dummy3,
56     const char *dummy4,
57     const char *dummy5)
58 {
59 	return (_nss_nis_constr(profattr_ops,
60 		sizeof (profattr_ops)/sizeof (profattr_ops[0]),
61 		NIS_MAP_PROFATTR));
62 }
63