MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: [SERVER] ALPHA release of LambdaMOO server 1.7.9



>   ********** The old GNU regex package had a bug in its handling of certain
>   ** NOTE ** patterns with parentheses in them, and it is reasonably likely
>   ********** that many MOO programmers have, perhaps unconsciously, come to
>   depend upon this buggy behavior.  Unfortunately for such programmers, RX
>   does not have this bug, so you will want to fix your regular expressions
>   before upgrading to this release; the fixed patterns will work correctly on
>   both releases.

Isn't backwards incompatibility great?

>     The old bug concerns patterns of the form `%( ... %)*', that is, a starred
>   parenthesized sub-pattern; for example, consider the MOO expression
>        match("foo", "%(o%)*")

I'm not sure what 'of the form' includes, but it also seems to include
patterns 'of the form': "%( ... %)+".
Could we get a list of *all* 'forms' that used to be 'wrong', to simplify
the 'fixing' task?

Oh great. I just tried ;match("foo", "%(o%)*") in both 1.7.8p4 and 1.7.9a1.
1.7.8p4 returns => {1, 0, {{0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0,
-1}, {0, -1}, {0, -1}, {0, -1}}, "foo"}
1.7.9a1 returns => {1, 0, {{0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0,
-1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0,
-1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0,
-1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}, {0, -1}}, "foo"}


>   To get the effect of the old bug, you need another set of parentheses around
>   the whole starred sub-pattern:
>        match("foo", "%(%(o%)*%)")

This is really great! Now regexp's are even more cryptic!
Wouldn't it be nice if regexps could include some kind of parentheses that
don't make the server keep the value matched? I mean, %( %) has currently
two functions. Many times I'd like to enclose a subpattern and not keep it
in the match output, especially if the pattern is complex and there are
many subpatterns to remember...

>   You should look carefully at your uses of match() and rmatch() before
>   upgrading to this release, fixing those places where your code depends on
>   the old, buggy behavior.

This is a great suggestion. Grepping code and fixing it is the best way to
discover hidden security holes.
 '@egrep [^:]match('  gave 'only' 122 verbs in BioMOO. Isn't backwards
incompatibility great?

Could someone suggest a better regexp to @egrep with, to make the task simpler?
Would "[^:]r?match(.*%%(.*%%)[+*]" be any better? Would this be comprehensive?
>From the results of '@egrep [^:]match(', I see there are various LambdaCore
uses of match that have variable regexps, which will of course make it very
nice to debug. Moreover, some receive the string to be matched, and the
pattern, as arguments. So you have to go back and check who calls the verb,
etc, etc, etc.

Bah, I'd better stop rambling. This looks like it isn't going to be a
trivial server change.
It would be great if people posted what changes are needed in LambdaCore.
Personally, I think this is a huge waste of time. Sometimes, broken seems
to be better.

-------------------------------------------------------------
Gustavo Glusman               Founder/administrator of BioMOO
-- Gustavo@bioinformatics.weizmann.ac.il
-- http://bioinformatics.weizmann.ac.il:70/0h/Gustavo/Glusman
-- BioMOO: telnet bioinformatics.weizmann.ac.il 8888
           WWW:   http://bioinfo.weizmann.ac.il:8888




Follow-Ups:

Home | Subject Index | Thread Index