/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1996, by Sun Microsystems, Inc.
* All rights reserved.
*/
#ident "%Z%%M% %I% %E% SMI" /* SMI4.1 1.5 */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "table.h"
#include "util.h"
#include "getgroup.h"
/*
* Stolen mostly, from getnetgrent.c
*
* my_getgroup() performs the same function as _getgroup(), but operates
*
* function can look up lines quickly.
*/
/* To check for cycles in netgroups */
struct list {
char *name;
};
static char *any();
static char *match();
static char *fill();
static void freegrouplist();
static void doit();
static void
{
}
}
struct grouplist *
char *group;
{
return (grouplist);
}
/*
* recursive function to find the members of netgroup "group". "list" is
* the path followed through the netgroups so far, to check for cycles.
*/
static void
char *group;
{
register char *p, *q;
char *val;
/*
* check for non-existing groups
*/
return;
}
/*
* check for cycles
*/
group);
return;
}
}
p = val;
while (p != NULL) {
while (*p == ' ' || *p == '\t')
p++;
if (*p == EOS || *p == '#')
break;
if (*p == '(') {
p++;
goto syntax_error;
}
goto syntax_error;
}
goto syntax_error;
}
} else {
q = any(p, " \t\n#");
if (q && *q == '#')
break;
*q = EOS;
*q = ' ';
}
p = any(p, " \t");
}
return;
}
/*
* Fill a buffer "target" selectively from buffer "start".
* "termchar" terminates the information in start, and preceding
* or trailing white space is ignored. If the buffer "start" is
* empty, "target" is filled with "*". The location just after the
* terminating character is returned.
*/
static char *
char *start;
char **target;
char termchar;
{
register char *p;
register char *q;
register char *r;
int size;
;
if (r == (char *)NULL) {
return ((char *)NULL);
}
if (p == r) {
} else {
for (q = r-1; *q == ' ' || *q == '\t'; q--)
;
size = q-p+1;
}
return (r+1);
}
/*
* scans cp, looking for a match with any character
* in match. Returns pointer to place in cp that matched
* (or NULL if no match)
*/
static char *
register char *cp;
char *match;
{
register char *mp, c;
while (c = *cp) {
if (*mp == c)
return (cp);
cp++;
}
return (NULL);
}
/*
* The equivalent of yp_match. Returns the match, or NULL if there is none.
*/
static char *
char *group;
{
}