summaryrefslogtreecommitdiff
path: root/lib/tmpdir.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-04-01 01:17:45 +0900
committerNobuyoshi Nakada <[email protected]>2021-04-05 21:08:57 +0900
commit4b6fa03a72b23fa03a8f37cbfdcad3f0251832cf (patch)
treef4272d22879e461ffbf4a4de34e17759b8b4082c /lib/tmpdir.rb
parent2f992272f20d29fe20e70555ffabe09cf80d8655 (diff)
[ruby/tmpdir] Make usable chars more strict
Remove other than alphanumeric and some punctuations considered filesystem-safe, instead of removing some unsafe chars only. https://hackerone.com/reports/1131465 https://github.com/ruby/tmpdir/commit/adf294bc2d
Diffstat (limited to 'lib/tmpdir.rb')
-rw-r--r--lib/tmpdir.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index 0b1f00aecf..bf7db5282a 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -115,7 +115,7 @@ class Dir
Dir.tmpdir
end
- UNUSABLE_CHARS = [File::SEPARATOR, File::ALT_SEPARATOR, File::PATH_SEPARATOR, ":"].uniq.join("").freeze
+ UNUSABLE_CHARS = "^,-.0-9A-Z_a-z~"
class << (RANDOM = Random.new)
MAX = 36**6 # < 0x100000000