🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #18456

Re: Newsgroup name limits and other oddities

#18456
From: Bruce Becker
Date: Fri, 13 Jun 1997 00:00
110 lines
4597 bytes
In article <EB5D0r.7rr@xcski.com>, Paul Tomblin <ptomblin@xcski.com> wrote:
|In a previous article, Andrew Gierth <andrew@erlenstar.demon.co.uk> said:
|>>>>>> "Paul" == Paul Tomblin <ptomblin@xcski.com> writes:
|> Paul> C-news (remember that?) by default doesn't like [A-Z], but you
|> Paul> can work around that.
|>
|>How easily?
|
|You have to modify namecheck.awk to allow the newsgroup names you want.
|To allow upper case names, you have to remove the lines:
|                else if (c ~ /[A-Z]/)
|                        print "uppercase letter(s) in name"
|
|You might also want to modify the other lines, such as:
|                else if (c ~ /[^a-z0-9+_-]/)
|                        print "illegal character(s) in name"
|                else if (c ~ /--|__|\+\+./)     # sigh, c++ etc must be allowed
|                        print "repeated punctuation in name"


	Below is the "multicultural" version we use around
	these parts for CNews...


  ,u,	 Bruce Becker		Toronto, Ontario	1 416 699 1868
a /i/	 Internet: bdb@gts.org	Uucp: ...!gts!bdb
 `\o\-e  You know, if it weren't for the graft, corruption and violence,
 _< /_	 	this city wouldn't be any fun at all	- Julie Winters

 --------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------

# awk program to check newsgroup names for validity, rigorously
# echo groupname | awk -f namecheck.awk
# It may look like some things in per-component checking could be done
# more efficiently by moving them into whole-name checking.  The presence
# of encoded name components messes this up.
NR == 1 {
	# whole-name checks
	bad = 1
	if (NF == 0)
		print "empty name"
	else if (NF > 1)
		print "white space in name"
	else if ($1 ~ /^\./ || $1 ~ /\.$/ || $1 ~ /\.\./)
		print "bad dot(s) in name"
	else if ($1 !~ /^[a-zA-Z]/)	# A-Z is caught later
		print "name does not begin with a letter"
	else if ($1 ~ /^(junk|control)\./)
		print "name starts with control or junk"
	else
		bad = 0
	if (bad == 1)
		exit 1

	# per-component checks
	nc = split($1, cpt, ".")
	for (i = 1; i <= nc; i++) {
		bad = 1
		c = cpt[i]
		# some of these two-part tests may look like they could be
		# simplified to one-parters, but some broken awks then fail
		if (c ~ /^=/ && c !~ /^=\?[^=?]+\?[^=?]+\?[^?]+\?=$/)
			print "name component resembles encoded word but isn't one"
		else if (c ~ /^=/ && c !~ /^=[a-zA-Z0-9+_=?-]*=$/)
			print "bad character in encoded name component"
		else if (c ~ /^=/ && c !~ /^=\?[^?]+\?b\?/)
			print "encoded name component does not use b encoding"
		else if (c ~ /^=/)
			bad = 0		# looks like an okay encoded word
		#else if (c ~ /^[0-9]*$/)
		#	print "all-numeric name component"
		else if (c !~ /^[a-zA-Z0-9]/)	# A-Z caught later
			print "name component starts with non-alphanumeric"
		else if (c !~ /[a-zA-Z0-9]/)	# A-Z caught later
			print "name component does not contain alphanumeric"
		else if (i == nc && (c == "all" || c == "ctl"))
			print "`all' or `ctl' used as name component"
		#else if (length(c) > 14)
		#	print "name component longer than 14 characters"
		#else if (c ~ /[A-Z]/)
		#	print "uppercase letter(s) in name"
		else if (c ~ /[^a-zA-Z0-9+_-]/)
			print "illegal character(s) in name"
		#else if (c ~ /--|__|\+\+./)	# sigh, c++ etc must be allowed
		#	print "repeated punctuation in name"
		#else if (c == cpt[i+1])
		#	print "repeated component(s) in name"
		else
			bad = 0

		if (bad == 1)
			exit 1
	}
}
NR >= 2 {
	print "newline(s) in name"
	exit 1
}
END {
	exit 0
}

-- 
  ,u,	 Bruce Becker		Toronto, Ontario	1 416 699 1868
a /i/	 Internet: bdb@gts.org	Uucp: ...!gts!bdb
 `\o\-e  You know, if it weren't for the graft, corruption and violence,
 _< /_	 	this city wouldn't be any fun at all	- Julie Winters

Technical Details
Message-ID: <EBp0E4.A0u.0.hotlips@GTS.Net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <87pvu6434y.fsf@erlenstar.demon.co.uk> <EB491B.3F7@xcski.com> <87lo4t3ljx.fsf@erlenstar.demon.co.uk> <EB5D0r.7rr@xcski.com>

Show Full Headers
Complete Article Headers
Message-ID: <EBp0E4.A0u.0.hotlips@GTS.Net>
Subject: Re: Newsgroup name limits and other oddities
Date: Fri, 13 Jun 1997 00:00:00 +0000
From: bdb@hotlips.gts.net (Bruce Becker)
References: <87pvu6434y.fsf@erlenstar.demon.co.uk> <EB491B.3F7@xcski.com> <87lo4t3ljx.fsf@erlenstar.demon.co.uk> <EB5D0r.7rr@xcski.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 248023693
Sender: bdb@GTS.Net (Bruce Becker)
Organization: G.T.S., Toronto, Ontario
Newsgroups: news.software.nntp,news.software.b
X-Newsposter: trn 4.0-test56 (2 Mar 97)