home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / hostcvt.pch < prev    next >
Encoding:
Text File  |  1992-04-18  |  3.5 KB  |  122 lines

  1. Newsgroups: comp.sources.unix
  2. From: rogers@amadeus.wr.tek.com (Roger S. Southwick)
  3. Subject: v26i017: hostcvt - convert /etc/hosts files into DNS zone files, Patch02
  4. Sender: unix-sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: rogers@amadeus.wr.tek.com (Roger S. Southwick)
  8. Posting-Number: Volume 26, Issue 17
  9. Archive-Name: hostcvt.pch2
  10.  
  11. This is Official patch #2 for the hostcvt program (v25i093).  This patch
  12. adds a -S flag which strips out any domains from the hostnames found in the
  13. input host file.  Also, this patch corrects my E-mail address in the 2 man
  14. pages and README file.
  15.  
  16. Feed this to the stdin of Larry Wall's fine patch program (I've tested with
  17. patch version 2.0.1.6 Patch level: 12) and enjoy the results.
  18.  
  19.     -Roger      (Roger.S.Southwick@tek.com)
  20.         UUCP:    ...!uunet!tektronix!Roger.S.Southwick
  21.         Roger.S.Southwick@email.hub.tek.com (Roger S. Southwick)
  22.  
  23. Index: main.c
  24. Prereq: 1.5
  25. 11c11
  26. < static char *RCSid = "$Id: main.c,v 1.5 91/12/07 16:51:15 rogers Release $";
  27. ---
  28. > static char *RCSid = "$Id: main.c,v 1.8 92/03/24 17:46:28 rogers Release $";
  29. 54c54
  30. <     char *strsave(), *malloc();
  31. ---
  32. >     char *strsave(), *malloc(), *index(), *strcpy();
  33. 58c58
  34. <     register char *ipaddr, **cpp;
  35. ---
  36. >     register char *ipaddr, **cpp, *cp;
  37. 60a61,63
  38. >     char ch, buf[BUFSIZ];
  39. >     int hostflag, soaflag, netflag, errflag, outputflag;
  40. >     int domainflag, kflag, Sflag;
  41. 62,65c65,66
  42. <     char ch;
  43. <     int hostflag, soaflag, netflag, errflag, outputflag, domainflag, kflag;
  44. <     kflag = hostflag = soaflag = netflag = errflag = outputflag = domainflag = 0;
  45. ---
  46. >     Sflag =  kflag = hostflag = soaflag = netflag = 0;
  47. >     errflag = outputflag = domainflag = 0;
  48. 69c70
  49. <     while ((ch = egetopt(argc, argv, "kh:n:o:s:")) != -1)
  50. ---
  51. >     while ((ch = egetopt(argc, argv, "Skh:n:o:s:")) != -1)
  52. 114a116,119
  53. >         case 'S':        /* Strip out domains */
  54. >         Sflag++;
  55. >         break;
  56. 133c138
  57. <     (void) fprintf(stderr, "usage: hostcvt [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
  58. ---
  59. >     (void) fprintf(stderr, "usage: hostcvt [-k] [-S] [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
  60. 175a181,195
  61. >     if(Sflag){
  62. >         (void)strcpy(buf, hp->h_name);
  63. >         if((cp = index(buf,  '.')) != NULL){
  64. >         *cp = '\0';
  65. >         hp->h_name = strsave(buf);
  66. >         }
  67. >         for (cpp = hp->h_aliases; *cpp != NULL; cpp++) {
  68. >         (void)strcpy(buf, *cpp);
  69. >         if((cp = index(buf,  '.')) != NULL){
  70. >             *cp = '\0';
  71. >             *cpp  = strsave(buf);
  72. >         }
  73. >         }
  74. >     }
  75. Index: hostcvt.8
  76. Prereq: 1.3
  77. 2c2
  78. < .\" $Id: hostcvt.8,v 1.3 91/12/07 16:56:22 rogers Release $
  79. ---
  80. > .\" $Id: hostcvt.8,v 1.5 92/03/24 17:40:29 rogers Release $
  81. 4c4
  82. < .TH HOSTCVT 8 "10-3-90"
  83. ---
  84. > .TH HOSTCVT 8 "03-24-92"
  85. 11a12,13
  86. > .I -S
  87. > ] [
  88. 62a65,67
  89. > .BI \-S
  90. > Strip any domain portion from the hostnames and aliases.
  91. > .TP
  92. 205c210
  93. < rogers@amadeus.wr.tek.com
  94. ---
  95. > Roger.S.Southwick@tek.com
  96. Index: nextserial.8
  97. Prereq: 1.1
  98. 2c2
  99. < .\" $Id: nextserial.8,v 1.1 90/10/03 23:34:03 rogers Release $
  100. ---
  101. > .\" $Id: nextserial.8,v 1.2 92/03/24 17:41:36 rogers Release $
  102. 65c65
  103. < rogers@dadla.wr.tek.com
  104. ---
  105. > Roger.S.Southwick@tek.com
  106. Index: README
  107. 3c3
  108. < No warrenty written or implied.  You are free to use this program
  109. ---
  110. > No warranty written or implied.  You are free to use this program
  111. 10,12c10,12
  112. <     -Roger      (rogers@amadeus.wr.tek.com)
  113. <         UUCP:    ...!uunet!tektronix!amadeus.wr.tek.com!rogers
  114. <         ARPA:    <@RELAY.CS.NET:rogers@amadeus.wr.tek.com>
  115. ---
  116. >     -Roger      (Roger.S.Southwick@tek.com)
  117. >         UUCP:   ...!uunet!tektronix!Roger.S.Southwick
  118.