Project

General

Profile

Bug #2685

Regular expression problems on checking installation media name

Added by Ivan Necas almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When creating a media with some format can lead to the foreman being stuck:

The root cause is the regular expression checking the name of media on spaces:

"SimpleOrg/Dev_Env/PublishedRHEL532 RHEL Server 5.9 i386" =~ /\A(\S+\s?)+\Z

This takes ages to compute.

On the other hand, it doesn't catch this example "My Media with trailing space "

The more efficient and working regexp should be

/\A(\S+\s)*\S+\Z/

Going to send a PR

(from https://bugzilla.redhat.com/show_bug.cgi?id=976362)

Associated revisions

Revision cd289277 (diff)
Added by Ivan Necas almost 6 years ago

fixes #2685 incorrect and inefficient regexp checking medium name format

It takes eternity to compute something like this:

"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b" =~ /\A(\S+\s?)+\Z

Also "this is wrong " was not matched

Revision 21f2b8d4 (diff)
Added by Ivan Necas almost 6 years ago

fixes #2685 incorrect and inefficient regexp checking medium name format

It takes eternity to compute something like this:

"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa b" =~ /\A(\S+\s?)+\Z

Also "this is wrong " was not matched
(cherry picked from commit cd2892774b6f6073bb189bd17ea7fcaec76388e6)

History

#1 Updated by Dominic Cleal almost 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Target version set to 1.2.0

#2 Updated by Ivan Necas almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF