mknetid.c (16729) | mknetid.c (16793) |
---|---|
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 --- 21 unchanged lines hidden (view full) --- 30 * SUCH DAMAGE. 31 * 32 * netid 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, 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 --- 21 unchanged lines hidden (view full) --- 30 * SUCH DAMAGE. 31 * 32 * netid 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: mknetid.c,v 1.5 1996/06/24 22:48:15 wpaul Exp $ | 38 * $Id: mknetid.c,v 1.1.1.1 1996/06/25 20:26:38 wpaul Exp $ |
39 */ 40 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <grp.h> 45#include <pwd.h> 46#include <netdb.h> 47#include <err.h> 48#include <rpc/rpc.h> 49#include <rpcsvc/yp_prot.h> 50#include <rpcsvc/ypclnt.h> 51#include "hash.h" 52 53#ifndef lint | 39 */ 40 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <grp.h> 45#include <pwd.h> 46#include <netdb.h> 47#include <err.h> 48#include <rpc/rpc.h> 49#include <rpcsvc/yp_prot.h> 50#include <rpcsvc/ypclnt.h> 51#include "hash.h" 52 53#ifndef lint |
54static const char rcsid[] = "$Id: mknetid.c,v 1.5 1996/06/24 22:48:15 wpaul Exp $"; | 54static const char rcsid[] = "$Id: mknetid.c,v 1.1.1.1 1996/06/25 20:26:38 wpaul Exp $"; |
55#endif 56 57#define LINSIZ 1024 58#define OPSYS "unix" 59 60/* Default location of group file. */ 61char *groupfile = _PATH_GROUP; 62/* Default location of master.passwd file. */ --- 138 unchanged lines hidden (view full) --- 201 if (lookup(dtable, writebuf)) { 202 if (!quiet) 203 warnx("duplicate netid '%s.%s@%s' -- skipping", 204 OPSYS, pidptr, domain); 205 continue; 206 } else { 207 mstore(dtable, writebuf, 0, 1); 208 } | 55#endif 56 57#define LINSIZ 1024 58#define OPSYS "unix" 59 60/* Default location of group file. */ 61char *groupfile = _PATH_GROUP; 62/* Default location of master.passwd file. */ --- 138 unchanged lines hidden (view full) --- 201 if (lookup(dtable, writebuf)) { 202 if (!quiet) 203 warnx("duplicate netid '%s.%s@%s' -- skipping", 204 OPSYS, pidptr, domain); 205 continue; 206 } else { 207 mstore(dtable, writebuf, 0, 1); 208 } |
209 printf("%s.%s@%s\t\t%s:%s", OPSYS, pidptr, domain, pidptr, gidptr); | 209 printf("%s.%s@%s %s:%s", OPSYS, pidptr, domain, pidptr, gidptr); |
210 if ((glist = lookup(mtable, (char *)&readbuf)) != NULL) { 211 while(glist) { 212 if (glist->groupid != i) 213 printf(",%lu", glist->groupid); 214 glist = glist->next; 215 } 216 } 217 printf ("\n"); --- 25 unchanged lines hidden (view full) --- 243 if (lookup(dtable, (char *)&writebuf)) { 244 if (!quiet) 245 warnx("duplicate netid '%s' -- skipping", 246 writebuf); 247 continue; 248 } else { 249 mstore(dtable, (char *)&writebuf, 0, 1); 250 } | 210 if ((glist = lookup(mtable, (char *)&readbuf)) != NULL) { 211 while(glist) { 212 if (glist->groupid != i) 213 printf(",%lu", glist->groupid); 214 glist = glist->next; 215 } 216 } 217 printf ("\n"); --- 25 unchanged lines hidden (view full) --- 243 if (lookup(dtable, (char *)&writebuf)) { 244 if (!quiet) 245 warnx("duplicate netid '%s' -- skipping", 246 writebuf); 247 continue; 248 } else { 249 mstore(dtable, (char *)&writebuf, 0, 1); 250 } |
251 printf ("%s.%s@%s\t\t0:%s\n", OPSYS, ptr, domain, ptr); | 251 printf ("%s.%s@%s 0:%s\n", OPSYS, ptr, domain, ptr); |
252 } 253 254 fclose(hfp); 255 256 /* 257 * Lastly, copy out any extra information in the netid 258 * file. If it's not open, just ignore it: it's optional anyway. 259 */ --- 30 unchanged lines hidden --- | 252 } 253 254 fclose(hfp); 255 256 /* 257 * Lastly, copy out any extra information in the netid 258 * file. If it's not open, just ignore it: it's optional anyway. 259 */ --- 30 unchanged lines hidden --- |