From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 23-MAY-1991 00:00:12.95
To:	ARISIA::EVERHART
CC:	
Subj:	Important patch for dxrn/mxrn

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.97)
	 id AA18221; Wed, 22 May 91 23:54:04 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Wed, 22 MAY 91 18:58:15 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA22281; Wed, 22 May 91 18:50:47 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 22 May 91 18:47:16 GMT
From: maverick.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!tp@rutgers.edu
Organization: The McCall Pattern Co., Manhattan, KS, USA
Subject: Important patch for dxrn/mxrn
Message-Id: <1991May22.184717.1000@mccall.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

A recent change to C news causes it to discard all postings and followups
from dxrn or mxrn if they are built with GENERATE_EXTRA_FIELDS defined. The
format of the Date: header is not acceptable to the recent version of C
news, because it does not have a comma (",") after the day of the week.

This probably mostly affects those using dxrn or mxrn to connect to an ANU
News nntp server, as it requires the message to contain Date: headers,
whereas most unix based nntp servers do not. 

If you run dxrn or mxrn with GENERATE_EXTRA_FIELDS defined, I strongly
suggest you apply this patch, as your articles are not being propagated to
the whole net, and will be dropped by even more sites as more of them
upgrade their version of C news.

Please do not assume that you are unaffected if nobody has told you there
is a problem. The messages printed by C news when it encounters one of
these messages does not give enough information for the C news
administrator to contact you about the problem without doing a fair bit of
work to locate the offending article. Also, there is a great deal of
"somebody else probably told him by now" going on. C news does not attempt
to contact the offending site, but simply prints a message in a log file
and discards the article (meaning, of course, that many sites never receive
it at all, and thus can not warn you about it).

The only module affected is compose.c, and the only change is to add a
comma after the day of the week returned by asctime(). This occurs in 3
places, each of which also needs a declaration of a temporary variable as a
lop counter (yeah, there are other ways to do it, but this is quick and
dirty).

This patch is for dxrn/mxrn version 6.14-4. If you have some other version,
and you are using GENERATE_EXTRA_FIELDS, you should make similar changes in
your version, or your news will continue to be discarded by C news sites on
the net (and there are a great many of these!).

*** compose.c_orig
--- compose.c
**************
*** 2422,2427
      time_t clockTime;
      char timeString[40];
      struct tm *cur_time;
  #endif
  
      if (ComposeActive) {
--- 2422,2428 -----
      time_t clockTime;
      char timeString[40];
      struct tm *cur_time;
+     int i;
  #endif
  
      if (ComposeActive) {
**************
*** 2472,2478
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
--- 2473,2481 -----
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
**************
*** 2478,2484
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");
--- 2481,2489 -----
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");
**************
*** 2546,2551
      time_t clockTime;
      char *ptr, timeString[40];
      struct tm *cur_time;
  #endif
  
      if (ComposeActive) {
--- 2551,2557 -----
      time_t clockTime;
      char *ptr, timeString[40];
      struct tm *cur_time;
+     int i;
  #endif
  
      if (ComposeActive) {
**************
*** 2592,2598
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
--- 2598,2606 -----
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
**************
*** 2598,2604
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");
--- 2606,2614 -----
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");
**************
*** 2661,2666
      time_t clockTime;
      char *ptr, timeString[40];
      struct tm *cur_time;
  #endif
  
      if (ComposeActive) {
--- 2671,2677 -----
      time_t clockTime;
      char *ptr, timeString[40];
      struct tm *cur_time;
+     int i;
  #endif
  
      if (ComposeActive) {
**************
*** 2725,2731
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
--- 2736,2744 -----
      (void) time(&clockTime);
      cur_time = gmtime(&clockTime);
      if(cur_time){
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " GMT");
**************
*** 2731,2737
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString, asctime(cur_time));
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");
--- 2744,2752 -----
          (void) strcat(timeString, " GMT");
      } else {
          cur_time = localtime(&clockTime);
!         (void) strcpy(timeString+1, asctime(cur_time));
!         for(i = 0; i < 3; i++)timeString[i] = timeString[i+1];
!         timeString[3] = ',';
          ptr = index(timeString, '\n');
          *ptr = '\0';
          (void) strcat(timeString, " ");


-- 
Terry Poot <tp@mccall.com>                   The McCall Pattern Company
(uucp: ...!rutgers!ksuvax1!deimos!mccall!tp) 615 McCall Road
(800)255-2762, in KS (913)776-4041           Manhattan, KS 66502, USA

