tonyb@tektools.UUCP (Tony Birnseth) (09/09/86)
Description: Under 2.10.3 news aliasing does not happen when: Posting: at any stage. Receiveing: When aliased newsgroup is in active file. This prevents having a cross over period when software gets articles posted to the desired groups. With the changeover to the new newsgroups upon us, it is necessary to make the change as transparent and informative to the user as possible. The user should be informed of aliasing at the time of posting. In addition, both the target of the aliased group and the old group must be able to coexist for a reasonable changeover to occur. Repeat by: add a line like: foo.bar net.test to LIBDIR/aliases and try posting to foo.bar. You will get "Invalid newsgroup message". and add a different line like: net.test local.test to LIBDIR/aliases and post from a downstream site. When received, the alias will be ignored. Fix: The following patch will force an alias lookup for each article received. Unfortunately, this will increase runtime since an alias lookup is required from disk for each invocation of inews/rnews. I feel the trade off is fair since it will reduce my administrative hours considerably over the newsgroup changeover period. In addition, this will help feeder sites do most of the changeover work for their downstream neighbors. *** /tmp/,RCSt1007237 Mon Sep 8 22:02:07 1986 --- ifuncs.c Mon Sep 8 21:42:10 1986 *************** *** 1,5 #ifndef lint ! static char *RCSid = "$Header: ifuncs.c,v 1.0 86/01/11 19:08:06 news Exp $"; #endif /* * ifuncs - functions used by inews. --- 1,5 ----- #ifndef lint ! static char *RCSid = "$Header: ifuncs.c,v 1.1 86/09/08 21:38:19 tonyb Exp $"; #endif /* * ifuncs - functions used by inews. *************** *** 683,688 * exit with error if not valid. * */ ngfcheck(isproc) int isproc; --- 683,701 ----- * exit with error if not valid. * */ + #define TEK_ALIAS + #ifdef TEK_ALIAS + /* + * Alias outgoing as well as incomming news. + * + * Do NOT require that the newsgroup being aliased 'from' be in the active file. + * + * Notibly, this causes ngfcheck() to be slower, requiring an alias search + * for every article. This does allow true aliasing to occur for the + * newsgroup changeover currently in progress. + * tonyb@tektronix.com + */ + #endif /* TEK_ALIAS */ ngfcheck(isproc) int isproc; *************** *** 692,697 register char *os1; int ngroups = 1; char tbuf[BUFLEN], ngcheck[AFSIZ]; f = xfopen(ACTIVE, "r"); s1 = ngcheck; --- 705,713 ----- register char *os1; int ngroups = 1; char tbuf[BUFLEN], ngcheck[AFSIZ]; + #ifdef TEK_ALIAS + int hit = 0; + #endif /* TEK_ALIAS */ f = xfopen(ACTIVE, "r"); s1 = ngcheck; *************** *** 744,749 while (*s2++ != '\0') ; } if (*s2 == '\0') { /* not found. remove it */ if (!isproc) { logerr("Invalid news group '%s'", s1); --- 760,766 ----- while (*s2++ != '\0') ; } + #ifndef TEK_ALIAS if (*s2 == '\0') { /* not found. remove it */ if (!isproc) { logerr("Invalid news group '%s'", s1); *************** *** 749,754 logerr("Invalid news group '%s'", s1); newssave(stdin, (char *)NULL); } /* See if it's in our alias list */ f = xfopen(ALIASES,"r"); while (fscanf(f,"%s %s", tbuf, bfr) == 2 --- 766,775 ----- logerr("Invalid news group '%s'", s1); newssave(stdin, (char *)NULL); } + #else /* TEK_ALIAS */ + if ( *s2 ) + hit = 1; /* show a match found */ + #endif /* TEK_ALIAS */ /* See if it's in our alias list */ f = xfopen(ALIASES,"r"); while (fscanf(f,"%s %s", tbuf, bfr) == 2 *************** *** 757,762 (void) fclose(f); if (strcmp(s1, tbuf) == 0) { logerr("Aliased newsgroup '%s' to '%s'", s1, bfr); os1 = s1; s1 = nbuf; s2 = tbuf; --- 778,784 ----- (void) fclose(f); if (strcmp(s1, tbuf) == 0) { logerr("Aliased newsgroup '%s' to '%s'", s1, bfr); + hit = 1; os1 = s1; s1 = nbuf; s2 = tbuf; *************** *** 775,780 /* copy back to original buffer */ tbufcpy(nbuf, tbuf); s1 = os1; } else { logerr("Unknown newsgroup '%s' removed", s1); s2 = s1; --- 797,803 ----- /* copy back to original buffer */ tbufcpy(nbuf, tbuf); s1 = os1; + #ifndef TEK_ALIAS } else { #else /* if TEK_ALIAS */ } else if( !hit ) { *************** *** 776,781 tbufcpy(nbuf, tbuf); s1 = os1; } else { logerr("Unknown newsgroup '%s' removed", s1); s2 = s1; while (*s2++ != '\0') /* skip the bad one */ --- 799,816 ----- s1 = os1; #ifndef TEK_ALIAS } else { + #else /* if TEK_ALIAS */ + } else if( !hit ) { + /* + * Didn't find in active or alias. Handle + * based on isproc. + */ + if (!isproc) { + logerr("Invalid news group '%s'", s1); + newssave(stdin, (char *)NULL); + } + /* Fall through if rnews */ + #endif /* TEK_ALIAS */ logerr("Unknown newsgroup '%s' removed", s1); s2 = s1; while (*s2++ != '\0') /* skip the bad one */ *************** *** 782,787 ; tbufcpy(s1, s2); } } else { /* It's in our active file */ os1 = s1; while (*s1++ != '\0') --- 817,823 ----- ; tbufcpy(s1, s2); } + #ifndef TEK_ALIAS } else { /* It's in our active file */ #endif /* TEK_ALIAS */ os1 = s1; *************** *** 783,788 tbufcpy(s1, s2); } } else { /* It's in our active file */ os1 = s1; while (*s1++ != '\0') ; --- 819,825 ----- } #ifndef TEK_ALIAS } else { /* It's in our active file */ + #endif /* TEK_ALIAS */ os1 = s1; while (*s1++ != '\0') ; *************** *** 795,800 tbufcpy(os1, s1); s1 = os1; } } } /* remove any duplicates */ --- 832,838 ----- tbufcpy(os1, s1); s1 = os1; } + #ifndef TEK_ALIAS } #endif /* TEK_ALIAS */ } *************** *** 796,801 s1 = os1; } } } /* remove any duplicates */ os1 = s1 = nbuf; --- 834,840 ----- } #ifndef TEK_ALIAS } + #endif /* TEK_ALIAS */ } /* remove any duplicates */ os1 = s1 = nbuf;