valid_name, valid_branch_name constraints allow trailing newline

Bug #137237 reported by Michael Hudson-Doyle
252
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Michael Hudson-Doyle

Bug Description

The pattern used in valid_branch_name (r"^[a-z0-9][a-z0-9\+\.\-]*$") allows a trailing newline in the branch name:

>>> re.match(r"^[a-z0-9][a-z0-9\+\.\-]*$", "a\n")
<_sre.SRE_Match object at 0xb7d8a790>

This breaks the generation of the rewritemap file, which breaks codebrowse.

Also, it's clearly not what was intended and just plain horrible.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Lets please fix this ASAP.

Changed in launchpad:
importance: Undecided → Critical
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

There's a fix waiting for the db thaw.

Changed in launchpad:
assignee: nobody → mwhudson
status: New → In Progress
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

RF 4830.

Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Fixed in 1.1.9. I filed bug #144462 (fixing some other constraints that are probably less urgent to fix) and bug #144463 (to test that the situation that led to me discovering this bug is fixed).

Changed in launchpad:
status: Fix Committed → Fix Released
William Grant (wgrant)
visibility: private → public
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.