Bug 520987

Summary: Ruby version packaged contains short-named constant bug
Product: [Fedora] Fedora Reporter: hdm
Component: rubyAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 11CC: hdm, jeremy, mtasaka, tagoh, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-03 04:16:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description hdm 2009-09-03 02:43:57 UTC
Description of problem:

The version of Ruby packaged on FC11 contains a bug in the use of short-named constants. This breaks certain Ruby applications that depend on this feature, including the Metasploit Framework. Gentoo and Ubuntu have now fixed their packages, but FC/RH has not yet.

Version-Release number of selected component (if applicable): 1.8.6


How reproducible:

Place this into a ruby script and run it:

#
# Check for the ugly 1.8.6/1.8.7 short-named constants bug
#

class ConstBugTestA
	Const = 'A'
	def test
		Const == 'A'
	end
end

ConstBugTestC = ConstBugTestA.dup

class ConstBugTestB < ConstBugTestC
	Const = 'B'
end

def ruby_187_const_bug
	bugged = false

	begin
		ConstBugTestA.new.test()
		ConstBugTestB.new.test()
	rescue ::NameError
		bugged = true
	end
	
	bugged
end

if(ruby_187_const_bug())
	$stderr.puts "This interpreter is broken!"
end


Alternatively, just run Metasploit:

Steps to Reproduce:
1. svn co https://metasploit.com/svn/framework3/trunk/ msf3/
2. ruby msf3/msfconsole
3. Look for the warning
  
Actual results:

Big warning message

Expected results:

No warning and working code

Additional info:

Solution:
https://bugs.launchpad.net/bugs/282302

Comment 1 Mamoru TASAKA 2009-09-03 04:16:19 UTC
Current F-11 ruby is ruby-1.8.6.369-1.fc11 and I cannot reproduce
this issue.

Comment 2 H D Moore 2009-09-04 12:39:41 UTC
Looks like it was user error in the report we received - they had built their own ruby version and forgotten about it (older Fedora releases did have this issue). Thanks!