home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.unix
- From: rogers@amadeus.wr.tek.com (Roger S. Southwick)
- Subject: v26i017: hostcvt - convert /etc/hosts files into DNS zone files, Patch02
- Sender: unix-sources-moderator@pa.dec.com
- Approved: vixie@pa.dec.com
-
- Submitted-By: rogers@amadeus.wr.tek.com (Roger S. Southwick)
- Posting-Number: Volume 26, Issue 17
- Archive-Name: hostcvt.pch2
-
- This is Official patch #2 for the hostcvt program (v25i093). This patch
- adds a -S flag which strips out any domains from the hostnames found in the
- input host file. Also, this patch corrects my E-mail address in the 2 man
- pages and README file.
-
- Feed this to the stdin of Larry Wall's fine patch program (I've tested with
- patch version 2.0.1.6 Patch level: 12) and enjoy the results.
-
- -Roger (Roger.S.Southwick@tek.com)
- UUCP: ...!uunet!tektronix!Roger.S.Southwick
- Roger.S.Southwick@email.hub.tek.com (Roger S. Southwick)
-
- Index: main.c
- Prereq: 1.5
- 11c11
- < static char *RCSid = "$Id: main.c,v 1.5 91/12/07 16:51:15 rogers Release $";
- ---
- > static char *RCSid = "$Id: main.c,v 1.8 92/03/24 17:46:28 rogers Release $";
- 54c54
- < char *strsave(), *malloc();
- ---
- > char *strsave(), *malloc(), *index(), *strcpy();
- 58c58
- < register char *ipaddr, **cpp;
- ---
- > register char *ipaddr, **cpp, *cp;
- 60a61,63
- > char ch, buf[BUFSIZ];
- > int hostflag, soaflag, netflag, errflag, outputflag;
- > int domainflag, kflag, Sflag;
- 62,65c65,66
- < char ch;
- < int hostflag, soaflag, netflag, errflag, outputflag, domainflag, kflag;
- <
- < kflag = hostflag = soaflag = netflag = errflag = outputflag = domainflag = 0;
- ---
- > Sflag = kflag = hostflag = soaflag = netflag = 0;
- > errflag = outputflag = domainflag = 0;
- 69c70
- < while ((ch = egetopt(argc, argv, "kh:n:o:s:")) != -1)
- ---
- > while ((ch = egetopt(argc, argv, "Skh:n:o:s:")) != -1)
- 114a116,119
- > case 'S': /* Strip out domains */
- > Sflag++;
- > break;
- >
- 133c138
- < (void) fprintf(stderr, "usage: hostcvt [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
- ---
- > (void) fprintf(stderr, "usage: hostcvt [-k] [-S] [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
- 175a181,195
- > if(Sflag){
- > (void)strcpy(buf, hp->h_name);
- > if((cp = index(buf, '.')) != NULL){
- > *cp = '\0';
- > hp->h_name = strsave(buf);
- > }
- > for (cpp = hp->h_aliases; *cpp != NULL; cpp++) {
- > (void)strcpy(buf, *cpp);
- > if((cp = index(buf, '.')) != NULL){
- > *cp = '\0';
- > *cpp = strsave(buf);
- > }
- > }
- > }
- >
- Index: hostcvt.8
- Prereq: 1.3
- 2c2
- < .\" $Id: hostcvt.8,v 1.3 91/12/07 16:56:22 rogers Release $
- ---
- > .\" $Id: hostcvt.8,v 1.5 92/03/24 17:40:29 rogers Release $
- 4c4
- < .TH HOSTCVT 8 "10-3-90"
- ---
- > .TH HOSTCVT 8 "03-24-92"
- 11a12,13
- > .I -S
- > ] [
- 62a65,67
- > .BI \-S
- > Strip any domain portion from the hostnames and aliases.
- > .TP
- 205c210
- < rogers@amadeus.wr.tek.com
- ---
- > Roger.S.Southwick@tek.com
- Index: nextserial.8
- Prereq: 1.1
- 2c2
- < .\" $Id: nextserial.8,v 1.1 90/10/03 23:34:03 rogers Release $
- ---
- > .\" $Id: nextserial.8,v 1.2 92/03/24 17:41:36 rogers Release $
- 65c65
- < rogers@dadla.wr.tek.com
- ---
- > Roger.S.Southwick@tek.com
- Index: README
- 3c3
- < No warrenty written or implied. You are free to use this program
- ---
- > No warranty written or implied. You are free to use this program
- 10,12c10,12
- < -Roger (rogers@amadeus.wr.tek.com)
- < UUCP: ...!uunet!tektronix!amadeus.wr.tek.com!rogers
- < ARPA: <@RELAY.CS.NET:rogers@amadeus.wr.tek.com>
- ---
- > -Roger (Roger.S.Southwick@tek.com)
- > UUCP: ...!uunet!tektronix!Roger.S.Southwick
- >
-