changeset 331:ff7a2dc6023e noffle

[svn] * src/client.c,src/group.c: Reunite forbidden group comment with code, and revise forbidden rules to allow single component names except for some specific ones.
author bears
date Wed, 26 Feb 2003 11:30:41 +0000
parents 56c3a43af1d5
children 2703d242de42
files ChangeLog src/client.c src/group.c
diffstat 3 files changed, 48 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 25 19:15:27 2003 +0000
+++ b/ChangeLog	Wed Feb 26 11:30:41 2003 +0000
@@ -1,4 +1,10 @@
-Fri Feb 31 2003 Jim Hague <jim.hague@acm.org>
+Wed Feb 26 2003 Jim Hague <jim.hague@acm.org>
+
+* src/client.c,src/group.c: Reunite forbidden group comment with code, and
+  revise forbidden rules to allow single component names except for some
+  specific ones.
+	
+Fri Feb 21 2003 Jim Hague <jim.hague@acm.org>
 
 * src/noffle.c: Give usage (rather than abort()) if option is unrecognised.
 * src/content.c: Tighten up checks when accessing content vector.
--- a/src/client.c	Tue Feb 25 19:15:27 2003 +0000
+++ b/src/client.c	Wed Feb 26 11:30:41 2003 +0000
@@ -1,7 +1,7 @@
 /*
   client.c
 
-  $Id: client.c 430 2003-02-10 18:28:30Z bears $
+  $Id: client.c 466 2003-02-26 11:30:41Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -35,15 +35,6 @@
 #include "wildmat.h"
 #include "portable.h"
 
-/*
-  Some newsgroups names are reserved for server-specific or server
-  pseudo groups. We don't want to fetch them. For example, INN
-  keeps all its control messages in a 'control' hierarchy, and
-  used the "to." hierarchy for dark and mysterious purposes I think
-  are to do with newsfeeds. The recommended restrictions are documented
-  in C.Lindsay, "News Article Format", <draft-ietf-usefor-article-03.txt>.
-*/
-
 struct
 {
     FILE* in;       /* Receiving socket from server */
--- a/src/group.c	Tue Feb 25 19:15:27 2003 +0000
+++ b/src/group.c	Wed Feb 26 11:30:41 2003 +0000
@@ -7,7 +7,7 @@
   loadGrp() and saveGrp(). This is done transparently. Access to the groups
   database is done by group name, by the functions defined in group.h.        
 
-  $Id: group.c 413 2002-12-27 21:48:25Z bears $
+  $Id: group.c 466 2003-02-26 11:30:41Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -67,15 +67,47 @@
     return gdbm_strerror( gdbm_errno );
 }
 
-/* forbidden hierarchies */
+/*
+  Some newsgroups names are reserved for server-specific or server
+  pseudo groups. We don't want to fetch them. For example, INN
+  keeps all its control messages in a 'control' hierarchy, and
+  used the "to." hierarchy for dark and mysterious purposes I think
+  are to do with newsfeeds. The recommended restrictions are documented
+  in C.Lindsay, "News Article Format", <draft-ietf-usefor-article-08.txt>.
+
+  Given that we shouldn't fetch them, it's also best if we don't allow them
+  to be created locally, to avoid potential confusion with downstream
+  readers/servers.
+
+  That being said, the draft also specifies restrictions on the character
+  set. Enforcing these generally would mean treating the name as
+  UTF-8 and inspecting for forbidden character ranges. This is left as
+  an exercise for the reader; for the meantime, Noffle will simply
+  apply the few remaining naming restrictions.
+*/
 struct ForbiddenGroupName
 {
     const char *pattern;
-    Bool match;
+    Bool match;				/* TRUE if match means 'invalid group name' */
 } forbiddenGroupNames[] =
 {
-/*    { "*[^-+_.0-9a-zA-Z]*", TRUE}, */      /* allow only traditional group names */
+#if 0
+	/*
+	  This is a tricky one. Single component newsgroups should be
+	  restricted to a local server or a LAN, and the draft highlights
+	  several single-component names which are typically pseudo-groups.
+	  Previously we've forbidden single component groups, but this is
+	  perhaps too harsh; you should be able to use Noffle to host them
+	  and pass them around other Noffles on the same LAN. So change to
+	  allowing single component names....
+	*/
     { "*.*", FALSE },                   /* Single component */
+#else
+	/* .. but forbidding the ones flagged as pseudo-groups in the draft */
+	{"control", TRUE },
+	{"junk", TRUE },
+	{"poster", TRUE },
+#endif	
     { "control.*", TRUE },              /* control.* groups */
     { "to.*", TRUE },                   /* to.* groups */
     { "*.all", TRUE },                  /* 'all' as a component */
@@ -86,7 +118,10 @@
     { "ctl.*", TRUE },
     { "example.*", TRUE },              /* example.* groups */
     { "*,*", TRUE },                    /* newsgroups separator */
-/*    { "_*", TRUE }, */                      /* reserved for future use, but accept nevertheless */
+#if 0
+	/* Not sure who decided this should be allowed, but leave it be. */
+	{ "_*", TRUE },						/* reserved for future use, but accept nevertheless */
+#endif	
     { "+*", TRUE },                     /* reserved */
     { "-*", TRUE }
 };