Bad regexp in emailregexp causes system lockout

RESOLVED FIXED in Bugzilla 2.18

Status

()

P2
normal
RESOLVED FIXED
17 years ago
6 years ago

People

(Reporter: bugreport, Assigned: justdave)

Tracking

2.14
Bugzilla 2.18
x86
Linux

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

17 years ago
If the preferences web interface is used to change emailregexp to 

$::param{'emailregexp'} = '^[^@]*@[^@]**$';

Subsequent login attempts result in....

Software error:

/^[^@]*@[^@]**$/: nested *?+ in regexp at CGI.pl line 707. 


And it is no longer possible to log in and fix it.   

Workaround - edit data/params to fix the erroneous pattern.

Suggested fix - add validation of regexps to forms that permit users to enter 
them
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.18
(Reporter)

Comment 1

16 years ago
Created attachment 93380 [details] [diff] [review]
Patch to test email regexps

Ok... about time to fix this
Comment on attachment 93380 [details] [diff] [review]
Patch to test email regexps

Put the \&checkregexp on a separate line to match prevailing style.

Also, eval qr/$value/ rather than doing a dummy match - its 'nicer'
Attachment #93380 - Flags: review-
(Reporter)

Comment 3

16 years ago
Created attachment 93381 [details] [diff] [review]
cleaner version
(Reporter)

Comment 4

16 years ago
Created attachment 93382 [details] [diff] [review]
this one....
Attachment #93380 - Attachment is obsolete: true
Attachment #93381 - Attachment is obsolete: true
Comment on attachment 93382 [details] [diff] [review]
this one....

>+sub checkregexp {
>+    my ($value) = (@_);
>+    eval { qr/$value/ };
>+    return $@ ;
>+}

r=bbaetz x2 if you remove the space before the ;
Attachment #93382 - Flags: review+
(Reporter)

Comment 6

16 years ago
Checking in defparams.pl;
/cvsroot/mozilla/webtools/bugzilla/defparams.pl,v  <--  defparams.pl
new revision: 1.81; previous revision: 1.80
done                                                    
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.