home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume1 / rn / patch01 < prev    next >
Text File  |  1986-11-30  |  6KB  |  221 lines

  1. Patch #: 1
  2. Priority: MEDIUM
  3. Subject: backpage can confuse header parser resulting in bad reply address
  4. >From: pmontgom@sdcrdcf.UUCP (Peter Montgomery)
  5.  
  6. Description:
  7.     If you use the 'b' backpage command to get back to the first page
  8.     of an article, the article header is reparsed wrong, and references
  9.     to %T, %t, %[relay-version], %[posting-version], %[path], and %[from]
  10.     will be incorrect.
  11.  
  12. Repeat-By:
  13.     Go to an article more than one page long.  Go forward one page, then
  14.     use 'b' to back up.  Then type 'r' to mail a reply.  The address
  15.     passed to Rnmail will consist of all the lines from relay-version to
  16.     from, which needless to say will confuse any mailer ever written.
  17.  
  18. Fix:    First of all, check to see if there is a "patchlevel" file in your
  19.     rn source directory.  If so, it probably indicates that some of
  20.     the patches have already been applied.
  21.  
  22.     If there is no patchlevel file, then in order to start recording
  23.     revision levels for the entire rn kit, cd to the rn source
  24.     directory and give the command:
  25.  
  26.     echo "Patch #: 0" >patchlevel
  27.  
  28.     If this is done correctly, patch will automatically update the
  29.     patchlevel file to reflect the maximum applied patch number.
  30.     (See the first patch below.)
  31.  
  32.     From rn, say "| patch -d DIR", where DIR is your rn source directory.
  33.     Outside of rn, say "cd DIR; patch <thisarticle".  If you don't have
  34.     the patch program, apply the following by hand, or get patch.
  35.  
  36.     Warning: this patch is not reversed.  If the patch program says
  37.     it is, then this patch has already been applied, and you should
  38.     not apply it again.
  39.  
  40.     If patch indicates that patchlevel is the wrong version the patch has
  41.     already been applied.  See the patchlevel file to find out what
  42.     has been applied.  Don't continue with the patch.
  43.  
  44. Index: patchlevel
  45. Prereq: 0
  46. 1c1
  47. < Patch #: 0
  48. ---
  49. > Patch #: 1
  50.  
  51. Index: art.c
  52. Prereq: 4.3
  53. *** art.c.old    Fri May 10 13:52:54 1985
  54. --- art.c    Fri May 10 13:52:59 1985
  55. ***************
  56. *** 1,4
  57. ! /* $Header: art.c,v 4.3 85/05/01 11:34:51 lwall Exp $
  58.    *
  59.    * $Log:    art.c,v $
  60.    * Revision 4.3  85/05/01  11:34:51  lwall
  61.  
  62. --- 1,4 -----
  63. ! /* $Header: art.c,v 4.3.1.2 85/05/10 13:46:07 lwall Exp $
  64.    *
  65.    * $Log:    art.c,v $
  66.    * Revision 4.3.1.2  85/05/10  13:46:07  lwall
  67. ***************
  68. *** 1,6
  69.   /* $Header: art.c,v 4.3 85/05/01 11:34:51 lwall Exp $
  70.    *
  71.    * $Log:    art.c,v $
  72.    * Revision 4.3  85/05/01  11:34:51  lwall
  73.    * Baseline for release with 4.3bsd.
  74.    * 
  75.  
  76. --- 1,12 -----
  77.   /* $Header: art.c,v 4.3.1.2 85/05/10 13:46:07 lwall Exp $
  78.    *
  79.    * $Log:    art.c,v $
  80. +  * Revision 4.3.1.2  85/05/10  13:46:07  lwall
  81. +  * Fixed header reparse bug on backpage.
  82. +  * 
  83. +  * Revision 4.3.1.1  85/05/10  11:30:56  lwall
  84. +  * Branch for patches.
  85. +  * 
  86.    * Revision 4.3  85/05/01  11:34:51  lwall
  87.    * Baseline for release with 4.3bsd.
  88.    * 
  89. ***************
  90. *** 104,109
  91.           artpos = vrdary(artline);
  92.           if (artpos < 0)
  93.           artpos = -artpos;    /* labs(), anyone? */
  94.           fseek(artfp,artpos,0);
  95.           if (artpos < htype[PAST_HEADER].ht_minpos)
  96.           in_header = SOME_LINE;
  97.  
  98. --- 110,117 -----
  99.           artpos = vrdary(artline);
  100.           if (artpos < 0)
  101.           artpos = -artpos;    /* labs(), anyone? */
  102. +         if (firstpage)
  103. +         artpos = (ART_POS)0;
  104.           fseek(artfp,artpos,0);
  105.           if (artpos < htype[PAST_HEADER].ht_minpos)
  106.           in_header = SOME_LINE;
  107.  
  108. Index: head.c
  109. Prereq: 4.3
  110. *** head.c.old    Fri May 10 13:52:36 1985
  111. --- head.c    Fri May 10 13:52:39 1985
  112. ***************
  113. *** 1,4
  114. ! /* $Header: head.c,v 4.3 85/05/01 11:38:21 lwall Exp $
  115.    *
  116.    * $Log:    head.c,v $
  117.    * Revision 4.3  85/05/01  11:38:21  lwall
  118.  
  119. --- 1,4 -----
  120. ! /* $Header: head.c,v 4.3.1.2 85/05/10 13:47:25 lwall Exp $
  121.    *
  122.    * $Log:    head.c,v $
  123.    * Revision 4.3.1.2  85/05/10  13:47:25  lwall
  124. ***************
  125. *** 1,6
  126.   /* $Header: head.c,v 4.3 85/05/01 11:38:21 lwall Exp $
  127.    *
  128.    * $Log:    head.c,v $
  129.    * Revision 4.3  85/05/01  11:38:21  lwall
  130.    * Baseline for release with 4.3bsd.
  131.    * 
  132.  
  133. --- 1,12 -----
  134.   /* $Header: head.c,v 4.3.1.2 85/05/10 13:47:25 lwall Exp $
  135.    *
  136.    * $Log:    head.c,v $
  137. +  * Revision 4.3.1.2  85/05/10  13:47:25  lwall
  138. +  * Added debugging stuff.
  139. +  * 
  140. +  * Revision 4.3.1.1  85/05/10  11:32:30  lwall
  141. +  * Branch for patches.
  142. +  * 
  143.    * Revision 4.3  85/05/01  11:38:21  lwall
  144.    * Baseline for release with 4.3bsd.
  145.    * 
  146. ***************
  147. *** 28,33
  148.       htypeix[*htype[i].ht_name - 'a'] = i;
  149.   }
  150.   
  151.   int
  152.   set_line_type(bufptr,colon)
  153.   char *bufptr;
  154.  
  155. --- 34,56 -----
  156.       htypeix[*htype[i].ht_name - 'a'] = i;
  157.   }
  158.   
  159. + #ifdef DEBUGGING
  160. + dumpheader(where)
  161. + char *where;
  162. + {
  163. +     register int i;
  164. +     printf("header: %d %s", parsed_art, where);
  165. +     for (i=0; i<HEAD_LAST; i++) {
  166. +     printf("%15s %4d %4d %03o\n",htype[i].ht_name,
  167. +         htype[i].ht_minpos,
  168. +         htype[i].ht_maxpos,
  169. +         htype[i].ht_flags) FLUSH;
  170. +     }
  171. + }
  172. + #endif
  173.   int
  174.   set_line_type(bufptr,colon)
  175.   char *bufptr;
  176. ***************
  177. *** 68,73
  178.   {
  179.       register int i;
  180.   
  181.       for (i=0; i<HEAD_LAST; i++) {
  182.       htype[i].ht_minpos = -1;
  183.       htype[i].ht_maxpos = 0;
  184.  
  185. --- 91,100 -----
  186.   {
  187.       register int i;
  188.   
  189. + #ifdef DEBUGGING
  190. +     if (debug & 4)
  191. +     dumpheader("start_header\n");
  192. + #endif
  193.       for (i=0; i<HEAD_LAST; i++) {
  194.       htype[i].ht_minpos = -1;
  195.       htype[i].ht_maxpos = 0;
  196. ***************
  197. *** 108,113
  198.           first_one = (htype[in_header].ht_minpos < 0);
  199.           if (first_one)
  200.           htype[in_header].ht_minpos = artpos;
  201.           if (htype[in_header].ht_flags & HT_HIDE)
  202.           return newhide;
  203.       }
  204.  
  205. --- 135,144 -----
  206.           first_one = (htype[in_header].ht_minpos < 0);
  207.           if (first_one)
  208.           htype[in_header].ht_minpos = artpos;
  209. + #ifdef DEBUGGING
  210. +         if (debug & 4)
  211. +         dumpheader(art_buf);
  212. + #endif
  213.           if (htype[in_header].ht_flags & HT_HIDE)
  214.           return newhide;
  215.       }
  216.  
  217.  
  218.