revnetgroup.c (24349) | revnetgroup.c (29574) |
---|---|
1/* 2 * Copyright (c) 1995 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 --- 21 unchanged lines hidden (view full) --- 30 * SUCH DAMAGE. 31 * 32 * reverse netgroup map generator program 33 * 34 * Written by Bill Paul <wpaul@ctr.columbia.edu> 35 * Center for Telecommunications Research 36 * Columbia University, New York City 37 * | 1/* 2 * Copyright (c) 1995 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 --- 21 unchanged lines hidden (view full) --- 30 * SUCH DAMAGE. 31 * 32 * reverse netgroup map generator program 33 * 34 * Written by Bill Paul <wpaul@ctr.columbia.edu> 35 * Center for Telecommunications Research 36 * Columbia University, New York City 37 * |
38 * $Id: revnetgroup.c,v 1.6 1997/02/22 14:22:03 peter Exp $ | 38 * $Id: revnetgroup.c,v 1.7 1997/03/28 15:48:15 imp Exp $ |
39 */ 40 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <errno.h> 45#include <err.h> 46#include "hash.h" 47 48#ifndef lint | 39 */ 40 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <errno.h> 45#include <err.h> 46#include "hash.h" 47 48#ifndef lint |
49static const char rcsid[] = "$Id: revnetgroup.c,v 1.6 1997/02/22 14:22:03 peter Exp $"; | 49static const char rcsid[] = "$Id: revnetgroup.c,v 1.7 1997/03/28 15:48:15 imp Exp $"; |
50#endif 51 52/* Default location of netgroup file. */ 53char *netgroup = "/etc/netgroup"; 54 55/* Stored hash table version of 'forward' netgroup database. */ 56struct group_entry *gtable[TABLESIZE]; 57 --- 87 unchanged lines hidden (view full) --- 145 /* 146 * Find all members of each netgroup and keep track of which 147 * group they belong to. 148 */ 149 for (i = 0; i < TABLESIZE; i++) { 150 gcur = gtable[i]; 151 while(gcur) { 152 __setnetgrent(gcur->key); | 50#endif 51 52/* Default location of netgroup file. */ 53char *netgroup = "/etc/netgroup"; 54 55/* Stored hash table version of 'forward' netgroup database. */ 56struct group_entry *gtable[TABLESIZE]; 57 --- 87 unchanged lines hidden (view full) --- 145 /* 146 * Find all members of each netgroup and keep track of which 147 * group they belong to. 148 */ 149 for (i = 0; i < TABLESIZE; i++) { 150 gcur = gtable[i]; 151 while(gcur) { 152 __setnetgrent(gcur->key); |
153 while(__getnetgrent(&host, &user, &domain) != NULL) { | 153 while(__getnetgrent(&host, &user, &domain) != 0) { |
154 if (hosts ? host && strcmp(host,"-") : user && strcmp(user, "-")) 155 mstore(mtable, hosts ? host : user, gcur->key, domain); 156 } 157 gcur = gcur->next; 158 } 159 } 160 161 /* Release resources used by the netgroup parser code. */ --- 23 unchanged lines hidden --- | 154 if (hosts ? host && strcmp(host,"-") : user && strcmp(user, "-")) 155 mstore(mtable, hosts ? host : user, gcur->key, domain); 156 } 157 gcur = gcur->next; 158 } 159 } 160 161 /* Release resources used by the netgroup parser code. */ --- 23 unchanged lines hidden --- |