lunarmodules / luasocket

Network support for the Lua language
http://lunarmodules.github.io/luasocket/
MIT License
1.83k stars 626 forks source link

Functions gethostbyname and gethostbyaddr are deprecated #407

Open marcosbc opened 1 year ago

marcosbc commented 1 year ago

Hi luasocket developers! While trying to build this library on Open Build Service, I received a warning:

binary-or-shlib-calls-gethostbyname /usr/local/lib/lua/5.1/socket/core.so
binary-or-shlib-calls-gethostbyname /usr/local/lib/lua/5.1/socket/serial.so
binary-or-shlib-calls-gethostbyname /usr/local/lib/lua/5.1/socket/unix.so
binary-or-shlib-calls-gethostbyname /usr/local/lib/lua/5.1/ssl.so
The binary calls gethostbyname(). Please port the code to use getaddrinfo().

It seems like this library is using gethostbyname and gethostbyaddr in src/usocket.h#L23, but these functions are obsolete and have been marked as deprecated in favor of getaddrinfo and getnameinfo. Note that this is explained in the man pages for gethostbyname: https://man7.org/linux/man-pages/man3/gethostbyname.3.html

I couldn't find any existing issues related to this, but if that isn't the case, feel free to close this.

alerque commented 1 year ago

PR contributions welcome! Several of us are around and helping to facilitate contributions, but none of us have much spare time for development work in this right now.