2N/A * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 2N/A * Copyright (c) 1996-1999 by Internet Software Consortium. 2N/A * Permission to use, copy, modify, and distribute this software for any 2N/A * purpose with or without fee is hereby granted, provided that the above 2N/A * copyright notice and this permission notice appear in all copies. 2N/A * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 2N/A * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 2N/A * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 2N/A * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 2N/A * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 2N/A * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 2N/A * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 2N/A#
define LINSIZ 1024 /*%< Length of netgroup file line */ 2N/A * This code is a hack-and-slash special. It realy needs to be 2N/A * rewritten with things like strdup, and realloc in mind. 2N/A * More reasonable data structures would not be a bad thing. 2N/A * Static Variables and functions used by setnetgrent(), getnetgrent() and 2N/A * There are two linked lists: 2N/A * \li linelist is just used by setnetgrent() to parse the net group file via. 2N/A * \li netgrp is the list of entries for the current netgroup 2N/A char *
l_line;
/*%< Netgroup entrie(s) to be parsed */ 2N/A char *
ng_str[
3];
/*%< Field pointers, see below */ 2N/A const char **,
const char **);
2N/A const char *,
const char *,
2N/A * Parse the netgroup file looking for the netgroup and build the list 2N/A * of netgrp structures. Let parse_netgrp() and read_for_group() do 2N/A * Get the next netgroup off the list. 2N/A * Search for a match in a netgroup. 2N/A * endnetgrent() - cleanup 2N/A * Parse the netgroup file setting up the linked lists. 2N/A * First, see if the line has already been read in. 2N/A /*fprintf(stderr, "Cycle in netgroup %s\n", lp->l_groupname);*/ 2N/A /*fprintf(stderr, "Bad netgroup %s at ..%s\n", lp->l_groupname, 2N/A * Read the netgroup file and save lines until the line for the netgroup 2N/A * is found. Return 1 if eof is encountered. 2N/A * Loop around handling line continuations. 2N/A * If this is the one we wanted, we are done.