gethostbyaddr is marked as obsolete and thread-unsafe in recent linux manpages. The corresponding code should be changed to use getaddrinfo or at least gethostbyaddr_r
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner TopicCleanup) [NinjaEdit]
removing skillLinux keyword. There is no such thing at https://wiki.documentfoundation.org/Development/Easy_Hacks/lists/by_Required_Skill and having a "skill*" keyword makes the easyHack not even appear on that page even in "uncategorized".
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
What about windows? Is it thread-safe on windows?
sal/osl/unx/socket.cxx
Submitted a patch here - https://gerrit.libreoffice.org/29909. I checked the links here - http://www.ibm.com/support/knowledgecenter/ssw_i5_54/rzab6/xthread.htm and https://linux.die.net/man/3/gethostbyaddr_r gethostbyaddr_r is thread safe.
(In reply to Sudarshan K from comment #6) > Submitted a patch here - https://gerrit.libreoffice.org/29909. I checked the > links here - > http://www.ibm.com/support/knowledgecenter/ssw_i5_54/rzab6/xthread.htm > and > https://linux.die.net/man/3/gethostbyaddr_r > gethostbyaddr_r is thread safe. No need to comment in the bug, we see the patch in gerrit and it has already been commented and the tdf#<number> in the patch makes the connection.
Why have you set yourself as QA contact ? you have submitted a patch so surely you are assignee (and status == ASSIGNED)
(In reply to jan iversen from comment #8) > Why have you set yourself as QA contact ? you have submitted a patch so > surely you are assignee (and status == ASSIGNED) I saw that, I must have done it by mistake. I have taken myself off it. Although I have assigned myself the bug, since I'm working on it.
Hey, so I'm stuck at a problem here. I will try to define it in a succinct manner. 1. gethostbyaddr and gethostbyaddr_r(its thread-safe but deprecated counterpart) both return a struct hostent. Consequently a lot of functions and datatypes internally have been defined using this struct hostent (e.g.hostentToHostAddr). 2. Whereas, getaddrinfo stores its results in a struct addrinfo. This in turn is used to iterate through the resultant addresses obtained. Suffice to say, addrinfo and hostent are very different. The two possible ways to solve this is - 1. Try to convert the struct addrinfo into struct hostent. By that, I meant copy the resultant parameters in addrinfo with the ones in hostent. At this point, I don't even know if its possible or not. I will check forums/SO/man-pages etc to see. Or Maybe addrinfo can be made compatible with hostent (????) 2. Or modify the existing data-types/internal functions using hostent to use addrinfo instead. Or add new data-types/functions to use addrinfo. I doubt this would remain an easy-hack then. Or maybe I'm missing something and this hack isn't that complicated at all. In that case, kindly give me some hints to solve it. Thanks.
(In reply to Sudarshan K from comment #10) > Hey, so I'm stuck at a problem here. I will try to define it in a succinct > manner. > 1. gethostbyaddr and gethostbyaddr_r(its thread-safe but deprecated > counterpart) both return a struct hostent. Consequently a lot of functions > and datatypes internally have been defined using this struct hostent > (e.g.hostentToHostAddr). I cannot follow that argument, if you decipher the structures follow the calls, you will see that only very limited info is used: struct oslHostAddrImpl { 555 rtl_uString *pHostName; 556 oslSocketAddr pSockAddr; 557 } ; > > 2. Whereas, getaddrinfo stores its results in a struct addrinfo. This in > turn is used to iterate through the resultant addresses obtained. Suffice to > say, addrinfo and hostent are very different. > > The two possible ways to solve this is - > 1. Try to convert the struct addrinfo into struct hostent. By that, I meant > copy the resultant parameters in addrinfo with the ones in hostent. At this > point, I don't even know if its possible or not. I will check > forums/SO/man-pages etc to see. Or Maybe addrinfo can be made compatible > with hostent (????) Yes you need to convert the information, but not be rebuilding the old structure, instead check what is actually needed. > > 2. Or modify the existing data-types/internal functions using hostent to use > addrinfo instead. Or add new data-types/functions to use addrinfo. I doubt > this would remain an easy-hack then. Well even the base struct oslHostAddrImpl is not used a lot of places, but I would not change all these places, but instead generate oslHostAddrImpl from the information the new call delivers. > > Or maybe I'm missing something and this hack isn't that complicated at all. > In that case, kindly give me some hints to solve it. Thanks.
A polite ping still working on this bug ?
Unassigned due to lack of work
A polite ping, still working on this bug
A polite ping, still working on this bug?
Hi, I work on this bug and use getnameinfo() instead of suggested getaddrinfo() since all we need from this is host's name. Am I missing something?
Hi, I'd like somebody review patch https://gerrit.libreoffice.org/#/c/42769/
Arkadiy Illarionov committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a6750166cdd9b39f4e948201143c70ea95def600 tdf#94695 Replace gethostbyaddr with getnameinfo It will be available in 6.0.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for the fix!