Deleted Added
full compact
mknetid.c (17115) mknetid.c (19143)
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.2 1996/06/27 05:42:01 wpaul Exp $
38 * $Id: mknetid.c,v 1.3 1996/07/12 05:55:38 bde Exp $
39 */
40
41#include <sys/types.h>
42
43#include <rpc/rpc.h>
44#include <rpcsvc/yp_prot.h>
45#include <rpcsvc/ypclnt.h>
46
47#include <err.h>
48#include <grp.h>
49#include <pwd.h>
50#include <netdb.h>
51#include <stdio.h>
52#include <stdlib.h>
53#include <string.h>
54
55#include "hash.h"
56
57#ifndef lint
39 */
40
41#include <sys/types.h>
42
43#include <rpc/rpc.h>
44#include <rpcsvc/yp_prot.h>
45#include <rpcsvc/ypclnt.h>
46
47#include <err.h>
48#include <grp.h>
49#include <pwd.h>
50#include <netdb.h>
51#include <stdio.h>
52#include <stdlib.h>
53#include <string.h>
54
55#include "hash.h"
56
57#ifndef lint
58static const char rcsid[] = "$Id: mknetid.c,v 1.2 1996/06/27 05:42:01 wpaul Exp $";
58static const char rcsid[] = "$Id: mknetid.c,v 1.3 1996/07/12 05:55:38 bde Exp $";
59#endif
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. */

--- 201 unchanged lines hidden (view full) ---

268 continue;
269 if ((ptr = strpbrk((char*)&readbuf, " \t")) == NULL) {
270 warnx("bad netid entry: '%s'", readbuf);
271 continue;
272 }
273
274 writebuf[0] = *ptr;
275 *ptr = '\0';
59#endif
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. */

--- 201 unchanged lines hidden (view full) ---

268 continue;
269 if ((ptr = strpbrk((char*)&readbuf, " \t")) == NULL) {
270 warnx("bad netid entry: '%s'", readbuf);
271 continue;
272 }
273
274 writebuf[0] = *ptr;
275 *ptr = '\0';
276 snprintf(writebuf, sizeof(readbuf), "%s.%s@%s", OPSYS,
277 ptr, domain);
278 if (lookup(dtable, (char *)&readbuf)) {
279 if (!quiet)
280 warnx("duplicate netid '%s' -- skipping",
281 readbuf);
282 continue;
283 } else {
284 mstore(dtable, (char *)&readbuf, 0, 1);
285 }
286 *ptr = writebuf[0];
287 printf("%s",readbuf);
288 }
289 fclose(nfp);
290 }
291
292 exit(0);
293}
276 if (lookup(dtable, (char *)&readbuf)) {
277 if (!quiet)
278 warnx("duplicate netid '%s' -- skipping",
279 readbuf);
280 continue;
281 } else {
282 mstore(dtable, (char *)&readbuf, 0, 1);
283 }
284 *ptr = writebuf[0];
285 printf("%s",readbuf);
286 }
287 fclose(nfp);
288 }
289
290 exit(0);
291}