1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 41 unchanged lines hidden (view full) --- 50#include <stdlib.h> 51#include <string.h> 52#include <unistd.h> 53 54#include "hash.h" 55 56#ifndef lint 57static const char rcsid[] = |
58 "$FreeBSD: head/libexec/mknetid/mknetid.c 90779 2002-02-17 19:09:20Z imp $"; |
59#endif /* not lint */ 60 61#define LINSIZ 1024 62#define OPSYS "unix" 63 64/* Default location of group file. */ 65char *groupfile = _PATH_GROUP; 66/* Default location of master.passwd file. */ --- 10 unchanged lines hidden (view full) --- 77struct member_entry *mtable[TABLESIZE]; 78 79/* 80 * Dupe table: used to keep track of entries so we don't 81 * print the same thing twice. 82 */ 83struct member_entry *dtable[TABLESIZE]; 84 |
85extern struct group *_getgrent(void); 86extern int _setgrent(void); 87extern void _endgrent(void); |
88 89static void |
90usage(void) |
91{ 92 fprintf (stderr, "%s\n%s\n", 93 "usage: mknetid [-q] [-g group_file] [-p passwd_file] [-h hosts_file]", 94 " [-d netid_file] [-d domain]"); 95 exit(1); 96} 97 98extern FILE *_gr_fp; 99 100int |
101main(int argc, char *argv[]) |
102{ 103 FILE *gfp, *pfp, *hfp, *nfp; 104 char readbuf[LINSIZ]; 105 char writebuf[LINSIZ]; 106 struct group *gr; 107 struct grouplist *glist; 108 char *domain; 109 int ch; --- 182 unchanged lines hidden --- |