2 * Copyright (c) 1996, 1998 by Internet Software Consortium.
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
9 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
11 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
13 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
14 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
18 #if defined(LIBC_SCCS) && !defined(lint)
19 static const char rcsid[] = "$Id: nis.c,v 1.10 1998/03/21 00:59:50 halley Exp $";
24 #include "port_before.h"
30 #include <rpcsvc/yp_prot.h>
31 #include <rpcsvc/ypclnt.h>
39 #include "port_after.h"
47 static void nis_close(struct irs_acc *);
52 irs_nis_acc(const char *options) {
57 if (yp_get_default_domain(&domain) != 0)
59 if (!(nis = malloc(sizeof *nis))) {
63 memset(nis, 0, sizeof *nis);
64 if (!(acc = malloc(sizeof *acc))) {
69 memset(acc, 0x5e, sizeof *acc);
71 nis->domain = strdup(domain);
73 acc->gr_map = irs_nis_gr;
78 acc->pw_map = irs_nis_pw;
82 acc->sv_map = irs_nis_sv;
83 acc->pr_map = irs_nis_pr;
84 acc->ho_map = irs_nis_ho;
85 acc->nw_map = irs_nis_nw;
86 acc->ng_map = irs_nis_ng;
87 acc->close = nis_close;
94 nis_close(struct irs_acc *this) {
95 struct nis_p *nis = (struct nis_p *)this->private;
102 #endif /*WANT_IRS_NIS*/