This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 520987 - Ruby version packaged contains short-named constant bug
Ruby version packaged contains short-named constant bug
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
11
All Linux
low Severity high
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-02 22:43 EDT by hdm
Modified: 2009-09-04 08:39 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-03 00:16:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description hdm 2009-09-02 22:43:57 EDT
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 00:16:19 EDT
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 08:39:41 EDT
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!

Note You need to log in before you can comment on or make changes to this bug.