From: ko1@... Date: 2017-06-16T08:04:16+00:00 Subject: [ruby-core:81705] [Ruby trunk Feature#13385] [PATCH] Make Resolv::DNS::Name validation similar to host and dig commands Issue #13385 has been updated by ko1 (Koichi Sasada). Assignee set to akr (Akira Tanaka) ---------------------------------------- Feature #13385: [PATCH] Make Resolv::DNS::Name validation similar to host and dig commands https://bugs.ruby-lang.org/issues/13385#change-65395 * Author: pavel.mikhailyuk@gmail.com (Pavel Mikhailyuk) * Status: Open * Priority: Normal * Assignee: akr (Akira Tanaka) * Target version: ---------------------------------------- # Abstract Add validations similar to **host** and **dig** commands to `Resolv::DNS::Name.create` # Background `Resolv::DNS::Name.create(str)` does not make any domain name validation. So it returns false positive results for queries like ~~~ ruby [1] pry(main)> Resolv::DNS.new.getresources('.gmail....com', Resolv::DNS::Resource::IN::MX) => [#, @preference=10, @ttl=3600>, #, @preference=20, @ttl=3600>, #, @preference=5, @ttl=3600>, #, @preference=40, @ttl=3600>, #, @preference=30, @ttl=3600>] ~~~ while ~~~ text ~ dig .gmail....com MX dig: '.gmail....com' is not a legal name (empty label) ~~~ I added basic RFC validations in `Resolv::DNS::Label.split` to get `ArgumentError` with messages similar to **host** and **dig** commands. # Pull request [https://github.com/ruby/ruby/pull/1551](https://github.com/ruby/ruby/pull/1551) -- https://bugs.ruby-lang.org/ Unsubscribe: