/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* groups
*/
#include <alloca.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
static void showgroups(char *user);
int
{
int ngroups, i;
if (argc > 1) {
for (i = 1; i < argc; i++)
showgroups(argv[i]);
exit(0);
}
exit(1);
}
for (i = 0; i < ngroups; i++) {
sep = " ";
continue;
}
sep = " ";
}
(void) printf("\n");
return (0);
}
static void
{
char **cp;
int pwgid_printed = 0;
return;
}
setgrent();
/*
* To avoid duplicate group entries
*/
if (pwgid_printed == 0) {
sep = " ";
pwgid_printed = 1;
}
continue;
}
sep = " ";
break;
}
}
(void) printf("\n");
endgrent();
}