[patch] actsync rejects hannover._wichtig

Florian Schlichting fschlich at CIS.FU-Berlin.DE
Thu Mar 18 17:34:55 UTC 2010


Hi,

actsync rejects syncing newsgroups whose components start with '+', '-'
or '_'. RFC5536 in section 3.1.4 states that these MUST be accepted by
news servers (and innd does so), even though their use is reserved.
Legacy group names such as hannover._wichtig are our current use case
for this patch:

--- a/backends/actsync.c
+++ b/backends/actsync.c
@@ -1108,9 +1108,7 @@ get_active(char *host, int hostid, int *len, struct grp *grp, int *errs)
  *
  *     [.+-_]
  *
- * One cannot have two '.'s in a row.  The first character must be
- * alphanumeric.  The character following a '.' must be alphanumeric.
- * The name cannot end in a '.' character.
+ * One cannot have two '.'s in a row or end in a '.' character.
  *
  * If we are checking for all numeric components, (see num_chk) then
  * a component cannot be all numeric.  I.e,. there must be a non-numeric
@@ -1199,7 +1197,8 @@ bad_grpname(char *name, int num_chk)
         * last '.', or before the beginning if no previous '.'
         * has been seen.
         */
-           if ((!num_chk || non_num) && isascii(*(p+1)) && isalnum((int)*(p+1))) {
+           if ((!num_chk || non_num) && isascii(*(p+1)) && 
+                (isalnum((int)*(p+1)) || *(p+1) == '+' || *(p+1) == '-' || *(p+1) == '_' )) {
        ++p;            /* '.' is ok, and so is the next char */
        if (isdigit((int)*p)) { /* reset non_num as needed */
            non_num = false;



Note that this does not fix the case where the hierarchy name starts
with one of these characters, as I'm unaware of any such hierarchy. If
needed, backends/actsync.c:1142 would need to be amended accordingly.

While looking around for how this is handled in other parts of INN, I
wondered if newsgroups component syntax checking shouldn't be unified
someplace? For example, actsync properly checks for all-numeric
components, which would clash with tradspool article storage. A check in
innd/cc.c:988 (CCnewgroup), which is supposedly trying to do the same,
doesn't even catch 'ctlinnd newgroup 123.456.798':

    Name = av[0];
    if (Name[0] == '.' || strspn(Name, "0123456789") == strlen(Name))
        return "1 Illegal newsgroup name";


But that's just a side note here...

Florian



More information about the inn-workers mailing list