/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
/*
* For SUNWnskit - version 1.1
*/
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <pwd.h>
#include "util.h"
#include "table.h"
#include "getgroup.h"
/*
* Reverse the netgroup file. A flag of "-u" means reverse by username,
* one of "-h" means reverse by hostname. Each line in the output file
* will begin with a key formed by concatenating the host or user name
* with the domain name. The key will be followed by a tab, then the
* comma-separated, newline-terminated list of groups to which the
* user or host belongs.
*
* Exception: Groups to which everyone belongs (universal groups) will
* not be included in the list. The universal groups will be listed under
* the special name "*".
*
* Thus to find out all the groups that user "foo" of domain "bar" is in,
* lookup the groups under foo.bar, foo.*, *.bar and *.*.
*
*/
/* Stores a list of strings */
struct stringnode {
char *str;
};
/* Stores a list of (name,list-of-groups) */
struct groupentrynode {
char *name;
};
static char *nextgroup(void);
static void dumptable(void);
int
int argc;
char *argv[];
{
char *group;
int byuser;
} else {
"usage: %s -h (by host), %s -u (by user)\n",
exit(1);
}
}
dumptable();
return (0);
}
/*
*/
static char *
nextgroup(void)
{
char *group;
return (NULL);
}
}
return (group);
}
/*
* Dump out all of the stored info into a file
*/
static void
dumptable(void)
{
int i;
for (i = 0; i < TABLESIZE; i++) {
if (entry = grouptable[i]) {
while (entry) {
}
}
}
}
}
}
/*
* Add a netgroup to a user's list of netgroups
*/
static void
{
char *domain;
char *key;
if (!name) {
continue;
}
if (!domain) {
}
}
}
static groupentrylist
{
return (new);
}
static void
{
return;
}
}
}
static void
{
int key;
} else {
}
if (gel) {
} else {
}
}
}
/*
*/
static void
{
char *p;
char *group;
char *line;
; /* skip leading blanks */
for (; *p && *p != '#' && *p != ' ' && *p != '\t'; p++)
;
if (*p == EOS || *p == '#')
continue;
*p++ = EOS;
while (*p == ' ' || *p == '\t') {
p++;
}
if (*p == EOS || *p == '#')
continue;
}
}