Project

General

Profile

Actions

Feature #17944

open

Remove Socket.gethostbyaddr and Socket.gethostbyname

Added by pvalena (Pavel Valena) over 3 years ago. Updated 8 months ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:104229]

Description

It is marked as unsafe by our static analysis. Can it be removed now?

It was deprecated in:
https://bugs.ruby-lang.org/projects/ruby-master/repository/trunk/revisions/60266
https://bugs.ruby-lang.org/issues/13097

Updated by jaruga (Jun Aruga) 8 months ago ยท Edited

The commit for the deprecated documents was added in 2017.

Deprecation document for gethostbyname,gethostbyaddr.
https://github.com/ruby/ruby/commit/b5c6fc856100b17b6f20e6e792a02ee7e33306bc
Date: Sat Oct 21 13:13:02 2017 +0000

The commit for printng warning messages was added in 2020.

Show deprecation warning on Socket.gethostbyname and Socket.gethostbyaddr
https://github.com/ruby/ruby/commit/6d946665bd79a93fb98b2d25400d1b6174472302
Date: Sat Aug 29 17:18:59 2020 +0900

If we are hesitate to drop the functions, we may be able to drop the functions conditionally with the configure option(s) like this.

$ ./configure --disable-socket-gethostbyname --disable-socket-gethostbyaddr

or

$ ./configure --disable-socket-gethostbyname-and-addr
Actions

Also available in: Atom PDF

Like0
Like1