xref: /titanic_52/usr/src/lib/nsswitch/nis/common/getauuser.c (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
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 <stdlib.h>
31 #include <string.h>
32 #include <bsm/libbsm.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_AUDITUSER, argp->key.name, 0));
42 }
43 
44 
45 static nis_backend_op_t auuser_ops[] = {
46 	_nss_nis_destr,
47 	_nss_nis_endent,
48 	_nss_nis_setent,
49 	_nss_nis_getent_netdb,
50 	getbynam
51 };
52 
53 nss_backend_t  *
54 _nss_nis_audit_user_constr(const char *dummy1,
55     const char *dummy2,
56     const char *dummy3)
57 {
58 	return (_nss_nis_constr(auuser_ops,
59 		sizeof (auuser_ops)/sizeof (auuser_ops[0]),
60 		NIS_MAP_AUDITUSER));
61 }
62