[net.news.b] serious bug in news 2.10 distribution

mark@cbosgd.UUCP (05/23/83)

By accident, an old version of header.c went out with the 2.10 distribution.
As a result, some important changes did not get made.  These changes include
some code to be smart about ARPANET mailing addresses, code to deal with the
Approved: header line, and a few minor bug fixes.  The Approved line is needed
to handle the net.announce newsgroup.  This fix is important because if you
don't have it, you won't be able to get net.announce.  An editor script is
enclosed to upgrade your header.c - it assumes you have version 2.16 of the file.
Everyone running 2.10 please fix this ASAP.  Thank you.
	chmod +w header.c
	ed - header.c < XXX
	468a
		if (*hp->approved)
			fprintf(fp, "Approved: %s\n", hp->approved);
	.
	361a
		if (its("Approved: "))
			return APPROVED;
	.
	320c
			if (index(ptr, '@') && !index(ptr, '!') && !seenrelay)
	.
	280c
			p[SNLN] = '\0';
			sprintf(hp->oident, "%s.%s", p, lbuf+1);
	.
	277a
			if (!q)
				q = index(p, '>');
	.
	265c
			/*
			 * It may seem strange that we hardwire ".UUCP" in
			 * here instead of MYDOMAIN.  However, we are trying
			 * to guess what the domain was on the posting system,
			 * not the local system.  Since we don't really know
			 * what the posting system does, we just go with the
			 * majority - almost everyone will be a .UUCP if they
			 * didn't fill in their Message-ID.
			 */
			sprintf(hp->ident, "<%s@%s%s>", p, lbuf, ".UUCP");
	.
	233a

	.
	227a
		
		/* Check for an existing Internet address on the end. */
		at = index(user, '@');
		if (at) {
			dot = index(at, '.');
			if (dot) {
				strcpy(hp->from, user);
				return;
			}
			/* @ signs are illegal except for the biggie, so */
			*at = '%';
		}

	.
	220a
		char *at, *dot;
	.
	192a
					seenrelay = 1;
				}
	.
	191c
				if (hdrlineno == 1) {
	.
	184a
			case APPROVED:
				getfield(hp->approved);
				break;
	.
	104a
	#define APPROVED	21
	.
	32a
		seenrelay = 0;

	.
	16a
	static int seenrelay;

	.
	5c
	static char	*SccsId = "@(#)header.c	2.19	4/24/83";
	.
	w
	q
	XXX
	chmod -w header.c