Project

General

Profile

Actions

Bug #17738

closed

Ruby can still freeze ENV

Added by kachick (Kenichi Kamiya) 26 days ago. Updated 16 days ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
[ruby-core:102961]

Description

After https://bugs.ruby-lang.org/issues/15920 and https://github.com/ruby/ruby/commit/f53d7e4bfd604be6f8131c5460c29f4af16da117, ENV.freeze raises TypeError.
But we can still freeze ENV as below.

Kernel.instance_method(:freeze).bind(ENV).call()
p ENV.frozen? #=> true

This loophole should be ignored?

Updated by marcandre (Marc-Andre Lafortune) 25 days ago

I believe so, yes.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) 16 days ago

  • Status changed from Open to Rejected
Actions

Also available in: Atom PDF