[NNTP] wildmat-exact

Peter Robinson pmrobinson at gmx.net
Sat May 7 05:11:35 PDT 2005


Charles Lindsey said:
> In <20050505085035.GE57289 at finch-staff-1.thus.net>
> "Clive D.W. Feather" <clive at demon.net> writes:
> 
> >Charles Lindsey said:
> >> In draft26.pre-1.txt I find
> >> 
> >>      wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
> >>      wildmat-pattern = 1*wildmat-item
> >>        ; must not begin with "!" if not immediately preceded by "!"
> 
> Ah! I had missed the significance of that disambiguating sentence.

As will any implementor coming across this for the first time.  In any
case, it's (now) just a comment in the ABNF so it has no power to
disambiguate anything.

> >>      wildmat-item = wildmat-exact / wildmat-wild
> >>      wildmat-exact = %x21-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
> >>           UTF8-non-ascii ; exclude * , ? [ \ ]
> >>      wildmat-wild = "*" / "?"
> >> and
> >>      newsgroup-name = 1*wildmat-exact
> >> 
> >> So it seems to me that a wildmat-exact (and hence a newsgroup-name) can
> >> contain (and in particular start with) a '!'.
 
> >We wanted wildmats to be as general as possible so that they could be used
> >in other commands in the future. That's why they are allowed to contain
> >characters like " and !. When we started there was a command that used
> >wildmats against headers.
> 
> OK, I had forgotten all the previous exchanges on this (it was a long time
> ago). However, I am still unhappy, especially as wildmats are now used
> only for filtering newsgroup-names.
> 
> Suppose, for the sake of argument, that '!' were a permitted character in
> newsgroup-names (despite prohibitions to the contrary in RFC 1036 and
> Usefor). Then the following newsgroup-names could legitimately exist.
> 
>     !foo.bar
>     foo.bar
>     foo.baz
>     bar.foo
> 
> So the wildmat "!foo.bar" matches "!foo.bar", "foo.baz" and "bar.foo", and
> "!!foo.bar" matches "foo.bar", "foo.baz" and "bar.foo". You can have great
> fun working out other interesting effects.

Actually, assuming the disambiguating comment was normative, neither of
those are valid wildmats according to this spec.  You'd have to have
something like "a,!foo.bar" and "a,!!foo.bar".  Is there a good reason
why we don't have the following: ?

        wildmat = ["!"] wildmat-pattern *("," ["!"] wildmat-pattern)
                  ^^^^^

As things stand (wildmat as it is, the comment just a comment) I'd say
both your examples are legal and unambiguous but don't mean what you
wanted them to mean (they match exactly 1 and 0 groups respectively).

> However, I can see no way to write a wildmat that matches "!foo.bar" and
> nothing else.
> 
> So it seems that I cannot call NEWNEWS on just that group or, more
> importantly, I cannot write a news or nntp URI that opens just that one
> group,

> Life would be simpler if '!' was simply excluded from wildmat-exact.

I agree.

> >On 1st May 2001 you proposed removing it and I said that was "too minimal".
> >I can't find any further comments in the archives. However, if we're going
> >to change this from the then-consensus, such as it was, we need to discuss
> >it first.
> 
> OK. Discussion please.

There are two possibilities.  One is to enforce (and clarify) the
disambiguating comment, and live with the strange hole in wildmat
functionality for newsgroup names starting with "!".

The other possibility is to exclude ! from wildmat-exact.  Any future
extension that needs to use wildmats to match strings containing ! will
probably need to be able to match the other excluded characters (*?,\[])
as well as "!".  Presumably it will do that by permitting them and using
\ as an escape character.  In that case, handling ! is no different than
any of the others.

I favour the latter possibility.

These are both independent of whether we change the overall wildmat ABNF
to allow it to start with a "!", meaning not.

Regards,

Peter



More information about the ietf-nntp mailing list