[#403837] Why none of the block giving the expected output with the "enumerator"? — Arup Rakshit <lists@...>

Why none of the block giving the expected output with the "enumerator"?

9 messages 2013/02/02

[#403870] Confusion with Enum#with_object block argument construct — Arup Rakshit <lists@...>

C:\>irb

9 messages 2013/02/03

[#403920] Character classes use in Ruby — Love U Ruby <lists@...>

Can anyone help me by giving an explanatory example of each of the

13 messages 2013/02/04

[#403935] How to stop page loading using selenium-web driver? — Love U Ruby <lists@...>

How to stop page loading using selenium-web driver?

11 messages 2013/02/04

[#403972] Ruby could recognize the values when putting into a webpage text filed. — Love U Ruby <lists@...>

SGksCgpJIGhhdmUgc29tZSB2YWx1ZXMgaW4gbXkgRXhjZWwgYXMgYmVsb3c6

9 messages 2013/02/05

[#403986] old syntax? what's going on here — tamouse mailing lists <tamouse.lists@...>

I have this in a _spec.rb file: (a gem I inherited at work)

11 messages 2013/02/05

[#404005] Implementing DRY with a function call — Rob Marshall <lists@...>

Hi,

12 messages 2013/02/05

[#404006] using an instance variable inside a method — FirstName Surname <lists@...>

Hello.

19 messages 2013/02/05

[#404021] Not able get the label text incurred with <input> element — Love U Ruby <lists@...>

I do have a below `HTML`:

18 messages 2013/02/05

[#404025] Symbol.defined? — Student Jr <lists@...>

Symbol deserialization from external sources is now known to be

15 messages 2013/02/06

[#404058] Ruby 1.9.3-p362 on Mac OSX — Peter Bailey <lists@...>

Hi,

13 messages 2013/02/06

[#404082] Problem building Ruby 1.9.3 patchlevel 385 under AIX 7.1 — Ruby Student <ruby.student@...>

Hello World!

10 messages 2013/02/06

[#404101] Issues from an extreme beginner — Bruce Palmer <lists@...>

Hey guys, great to be part of such a great community! I look forward to

19 messages 2013/02/07
[#404104] Re: Issues from an extreme beginner — Bruce Palmer <lists@...> 2013/02/07

Ahh, thank you Matthew! That was just the push I needed!

[#404208] elegant way to determine if something is defined — tamouse mailing lists <tamouse.lists@...>

Something like:

15 messages 2013/02/10

[#404218] Ruby Equivalent to VB's "With"? — Joel Pearson <lists@...>

I've looked around but I couldn't find anything helpful on this,

11 messages 2013/02/10

[#404235] The "ruby way" to do desktop applications? — "guirec c." <lists@...>

Hello,

17 messages 2013/02/11

[#404238] Best books for "advanced" programmers — "guirec c." <lists@...>

Hello,

18 messages 2013/02/11

[#404245] Issue with Excel column values read. — Love U Ruby <lists@...>

Hi,

22 messages 2013/02/11

[#404344] Ruby command line options s and S — Love U Ruby <lists@...>

Can anyone help me to understand the difference between s and S with

15 messages 2013/02/13

[#404386] Re: Ruby command line options s and S — "D. Deryl Downey" <me@...>

Dude!

20 messages 2013/02/14

[#404387] Ruby Multithreaded producer-consumer problem — Abhijit Sarkar <lists@...>

Hi,

26 messages 2013/02/14
[#404896] Re: Ruby Multithreaded producer-consumer problem — Abhijit Sarkar <lists@...> 2013/02/24

Bump!

[#404456] skip iteration in each loop — Saurav Chakraborty <lists@...>

I want to skip iteration for few values depending on dynamic condition.

11 messages 2013/02/15

[#404491] so, what's the proper way to replace funcionality of GOTO ? — "Stu P. D'naim" <lists@...>

I need to make few scripts for tasks I do often manually, but last time

27 messages 2013/02/15
[#404492] Re: [from BASIC to Ruby] so, what's the proper way to replace funcionality of GOTO ? — Love U Ruby <lists@...> 2013/02/15

Stu P. D'naim wrote in post #1097111:

[#404494] Re: [from BASIC to Ruby] so, what's the proper way to replace funcionality of GOTO ? — Ryan Victory <ryan@...> 2013/02/15

Love U Ruby: I'm really not sure what you meant by that response, but

[#404570] What is Ruby's default constructor? — Love U Ruby <lists@...>

Hi,

12 messages 2013/02/17

[#404632] Re: splat operator and Ruby instance variable assignments — Marc Heiler <lists@...>

Ok, understood what the guy wants ...

17 messages 2013/02/19
[#404640] Re: splat operator and Ruby instance variable assignments — Love U Ruby <lists@...> 2013/02/19

Marc Heiler wrote in post #1097736:

[#404645] Re: splat operator and Ruby instance variable assignments — Ryan Davis <ryand-ruby@...> 2013/02/19

[#404646] Re: splat operator and Ruby instance variable assignments — Love U Ruby <lists@...> 2013/02/19

Ryan Davis wrote in post #1097840:

[#404647] Re: splat operator and Ruby instance variable assignments — Peter Hickman <peterhickman386@...> 2013/02/19

On 19 February 2013 20:35, Love U Ruby <lists@ruby-forum.com> wrote:

[#404648] Re: splat operator and Ruby instance variable assignments — Love U Ruby <lists@...> 2013/02/19

Peter Hickman wrote in post #1097848:

[#404696] THE CLASS/OBJECT CHICKEN-AND-EGG PARADOX — "Xavier R." <lists@...>

Hi,

25 messages 2013/02/20
[#404699] Re: THE CLASS/OBJECT CHICKEN-AND-EGG PARADOX — Matt Mongeau <halogenandtoast@...> 2013/02/20

Maybe you could provide more detail about what you are confused about. To

[#404700] Re: THE CLASS/OBJECT CHICKEN-AND-EGG PARADOX — "Xavier R." <lists@...> 2013/02/20

Matt Mongeau wrote in post #1098058:

[#404705] Re: THE CLASS/OBJECT CHICKEN-AND-EGG PARADOX — Matt Mongeau <halogenandtoast@...> 2013/02/20

It's not really a paradox. Take for example

[#404738] backslash substitution — Mario Ruiz <lists@...>

don't know why... but this is not working

18 messages 2013/02/21

[#404809] Difference of 2 dates interms of years. — "Xavier R." <lists@...>

how can we get the experience years between two dates(ex:2012-01-11 to

13 messages 2013/02/22

[#404817] Not able to understand the difference between "||=" and "|=". — "Xavier R." <lists@...>

>> a = []

12 messages 2013/02/22

[#404839] range is not assigning to the splat variable. — Love U Ruby <lists@...>

Why splat variable couldn't take in the below two code the "range" ->

10 messages 2013/02/23

[#404842] Why class returning its own name when "include" statement? — Love U Ruby <lists@...>

I was actually playing around with the class definition return values.

16 messages 2013/02/23
[#404844] Re: Why class returning its own name when "include" statement? — Love U Ruby <lists@...> 2013/02/23

@Stefano Yes you are right. The below code is proved that.

[#404867] how to see the class creation time in Ruby? — Love U Ruby <lists@...>

In Ruby any chance to see the last-modified time of a specific class?

15 messages 2013/02/23

[#404901] Confusion with `nil` value being produced by IRB in case of Array#size manipulation. — Love U Ruby <lists@...>

enum[int] =3D obj =E2=86=92 obj

10 messages 2013/02/24

[#404921] How should I print only the last combination when using Array#combination(n) ? — Love U Ruby <lists@...>

>> a = [1,2,3]

15 messages 2013/02/24

[#405026] Please, help (GCD) greatest common divisor. — Caddy Tonks Lupin <lists@...>

Write a program to read two integers and show their greatest common

17 messages 2013/02/26

[#405059] Does this specific sound library exist? — Dirk Vogel <lists@...>

Hi there,

16 messages 2013/02/26

[#405067] Mac OS 10.8.2 and openssl — "Dr. Hegewald" <hegewald@...>

Hi everybody,

24 messages 2013/02/27

[#405079] Why `10` not returned without the `return` from the block ? — Love U Ruby <lists@...>

CODE - I

10 messages 2013/02/27

[#405107] Object track llist for a particular class. — "Xavier R." <lists@...>

Say I have created more than one instances from a particular class as

13 messages 2013/02/27

[#405145] Discussion on Ruby's `alias` — Tukai Patra <lists@...>

>> class Foo

27 messages 2013/02/28

[#405175] telnet - how to loop through commands listed in a file — Bob Ford <lists@...>

Let me first explain what I'm trying to do. I have written a very

18 messages 2013/02/28

[ANN] JRuby 1.7.3 Released

From: Thomas E Enebo <tom.enebo@...>
Date: 2013-02-21 17:36:59 UTC
List: ruby-talk #404760
The JRuby community is pleased to announce the release of JRuby 1.7.3

    Homepage: http://www.jruby.org/
    Download: http://www.jruby.org/download

Alert Please note the primary reason for putting out 1.7.3 was to
address two security issues. Everyone should upgrade to 1.7.3 (details
on security issues below).

Note: This was a condensed release due to wanting to put out security
fixes. If the bugs you are waiting for have not been fixed we will be
fixing them for 1.7.4.

JRuby 1.7.3 is our third update release since JRuby 1.7.0. The primary
goal of 1.7 point releases is to fill out any missing compatibility
issues with Ruby 1.9.3. The community participation lately has been
great. Keep reporting issues and sending pull requests.

Changes of note:

    Security fix (no CVE) for DOS using entity expansion in REXML
    Security fix (CVE-2013-0269) for unsafe object creation using JSON
    Relicensed from CPL to EPL
    Fixed one regression in windows java native launcher
    A few encoding issues resolved
    42 issues fixed for 1.7.3

Note: These next two sections are write-ups by Aaron Patterson on the
security issues. JRuby 1.7.3 fixes both of these issues. You only need
to be aware of workarounds if it is impossible for you to update JRuby
to version 1.7.3.

=3D=3DRexml DOS Fix

=3D=3D=3DImpact

When reading text nodes from an XML document, the REXML parser can be
coerced in to allocating extremely large string objects which can
consume all of the memory on a machine, causing a denial of service.

Impacted code will look something like this:

    document =3D REXML::Document.new some_xml_doc
    document.root.text

When the text method is called, entities will be expanded. An attacker
can send a relatively small XML document that, when the entities are
resolved, will consume extreme amounts of memory on the target system.

Note that this attack is similar to, but different from the Billion
Laughs attack. This is also related to CVE-2013-1664.

All users running an affected release should either upgrade or use one
of the work arounds immediately.
Workarounds

If you cannot upgrade Ruby, use this monkey patch as a workaround:

    class REXML::Document
      @@entity_expansion_text_limit =3D 10_240

      def self.entity_expansion_text_limit=3D( val )
        @@entity_expansion_text_limit =3D val
      end

      def self.entity_expansion_text_limit
        @@entity_expansion_text_limit
      end
    end

    class REXML::Text
      def self.unnormalize(string, doctype=3Dnil, filter=3Dnil, illegal=3Dn=
il)
        sum =3D 0
        string.gsub( /\r\n?/, "\n" ).gsub( REFERENCE ) {
          s =3D self.expand($&, doctype, filter)
          if sum + s.bytesize > REXML::Document.entity_expansion_text_limit
            raise "entity expansion has grown too large"
          else
            sum +=3D s.bytesize
          end
          s
        }
      end

      def self.expand(ref, doctype, filter)
        if ref[1] =3D=3D ?#
          if ref[2] =3D=3D ?x
            [ref[3...-1].to_i(16)].pack('U*')
          else
            [ref[2...-1].to_i].pack('U*')
          end
        elsif ref =3D=3D '&amp;'
          '&'
        elsif filter and filter.include?( ref[1...-1] )
          ref
        elsif doctype
          doctype.entity( ref[1...-1] ) or ref
        else
          entity_value =3D DocType::DEFAULT_ENTITIES[ ref[1...-1] ]
          entity_value ? entity_value.value : ref
        end
      end
    end

This monkey patch will limit the size of the entity substitutions to
10k per node. REXML already defaults to only allow 10000 entity
substitutions per document, so the maximum amount of text that can be
generated by entity substitution will be around 98 megabytes.
JSON Security Fix CVE-2013-0269
Impact

When parsing certain JSON documents, the JSON gem can be coerced in to
creating Ruby symbols in a target system. Since Ruby symbols are not
garbage collected, this can result in a denial of service attack.

The same technique can be used to create objects in a target system
that act like internal objects. These =93act alike=94 objects can be used
to bypass certain security mechanisms and can be used as a spring
board for SQL injection attacks in Ruby on Rails.

Impacted code looks like this:

    JSON.parse(user_input)

Where the user_input variable will have a JSON document like this:

    {"json_class":"foo"}

The JSON gem will attempt to look up the constant =93foo=94. Looking up
this constant will create a symbol.

In JSON version 1.7.x, objects with arbitrary attributes can be
created using JSON documents like this:

    {"json_class":"JSON::GenericObject","foo":"bar"}

This document will result in an instance of JSON::GenericObject, with
the attribute =93foo=94 that has the value =93bar=94. Instantiating these
objects will result in arbitrary symbol creation and in some cases can
be used to bypass security measures.

PLEASE NOTE: this behavior does not change when using JSON.load.
JSON.load should never be given input from unknown sources. If you are
processing JSON from an unknown source, always use JSON.parse.

All users running an affected release should either upgrade or use one
of the work arounds immediately.
Workarounds

For users that cannot upgrade, please use the attached patches. If you
cannot use the attached patches, change your code from this:

    JSON.parse(json)

To this:

    JSON.parse(json, :create_additions =3D> false)

If you cannot change the usage of JSON.parse (for example you=92re using
a gem which depends on JSON.parse like multi_json), then apply this
monkey patch:

    module JSON
      class << self
        alias :old_parse :parse
        def parse(json, args =3D {})
          args[:create_additions] =3D false
          old_parse(json, args)
        end
      end
    end

Jira Issues resolved for 1.7.3

    JRUBY-7058 - NPE in BiVariableMap.getLocalVarNames() after clear()
    JRUBY-6887 - Thread.current.object_id inside an Enumerator is
different from outside it
    JRUBY-7048 - Kernel#gsub is not available when -p/-n command line
option specified.
    JRUBY-7068 - StringIO.open should accept any number of arguments
    JRUBY-7069 - Dir.home(nil) should be my home
    JRUBY-7079 - Uninitialized constant NameError should store a
symbol and not a string
    JRUBY-6793 - Update bouncycastle jars to the latest version. (1.47)
    JRUBY-7081 - Thread.current does not remain consistent between Fibers
    JRUBY-7091 - Infinity should not be roundable :)
    JRUBY-7035 - Rails 4 master doesn't start on JRuby 1.7.1 (OpenSSL::PKCS=
5)
    JRUBY-7001 - maven jruby-rake-plugin classpath goal fails on windows
    JRUBY-7084 - Interaction between oh-my-zsh configuration and jruby
shell script

Github Issues resolved for 1.7.3

    #537 - Add the complete text of the Eclipse Public License
    #536 - Fix occasionally failing spec.
    #534 - Fix Enumerable#find_each block arity
    #533 - Default indy off for early IBM Java 7 releases #477
    #532 - Current head switches on +indy before 1.7update14
    #529 - Combination of Enumerable#each_slice and Array#transpose
raises TypeError
    #528 - fix samples/mvm.rb
    #526 - Move to EPL from CPL
    #525 - Unexpected behaviour of `Enumerator#find_index` with block
(1.9 mode and HEAD)
    #519 - nailgun missing in src package
    #518 - Fix typos in "1.9/io/console.rb"
    #517 - Rational/Float/Fixnum/Bignum `.to_s.encoding` is US-ASCII
    #516 - krypt is not 1.8-compatible
    #512 - Update json to 1.7.6
    #511 - tty issue with drip
    #508 - added Junit test to help fixing bug #7058
    #506 - throw stringifies the name
    #504 - Infinite loop (or performance issue) writing using MultiByteEnco=
ding
    #494 - FFI::MemoryPointer#free may cause JVM crashes
    #492 - Add missing throw to default_internal=3D.
    #485 - Resolve #482 Array#zip with infinite enum results in OOM
    #482 - Combination of Array#zip and Array#cycle result in OOM
    #479 - Fix write loss on concurrent ivar table growth
    #477 - IBM J9 VM should also have INVOKEDYNAMIC_DEFAULT =3D false
    #470 - Bignum#div raise ZeroDivisionError if the argument is Float zero
    #466 - Bunch of fixes for IO.copy_stream
    #465 - Add const_get to java package Fixes #435
    #464 - [rfc] Support unmarshaling hashes created in MRI 1.9.1 with
US-ASCII strings
    #457 - Accept Encoding object for Encoding.compatible?
    #435 - support for const_get() in java_package_module_template



--=20
blog: http://blog.enebo.com       twitter: tom_enebo
mail: tom.enebo@gmail.com

In This Thread

Prev Next