The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Chipping Away At Hash Keys Reveals Human Futility

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Chipping Away At Hash Keys Reveals Human Futility Posted: Apr 4, 2005 5:35 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Chipping Away At Hash Keys Reveals Human Futility
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

For the last few days, the Hobix list has been stumped trying to uncover why Ruby keeps throwing up a can't modify frozen object exception. We’re just loading a YAML file that contains a list of plugins to load and optional settings for each plugin:

 - hobix/out/rss
 - hobix/out/atom
 - hobix/publish/ping: [http://ping.blo.gs:80/, http://rpc.weblogs.com:80/RPC2]

The code was attempting to untaint the Hash keys if they looked like safe file paths. But, since Hash keys are automatically frozen and immutable, Ruby throws an exception. Fine, fine. Lesson is: make sure you dup the Hash key before you need to modify it.

The real confusion, though, lied with a variation between Ruby 1.8.2-2 and Ruby 1.8.2-3 under Debian. It looks like the YAML module under 1.8.2-2 doesn’t propagate the tainting flag.

Read: Chipping Away At Hash Keys Reveals Human Futility

Topic: Orbjosn 0.0.4 Released Previous Topic   Next Topic Topic: Why Web Programming Matters Most

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use