This function is also used in _osl_getFullQualifiedDomainName, I check if the result of this function is correct, I'm checking the result of this function.<br><br><div class="gmail_quote">2011/11/13 Noel Grandin <span dir="ltr"><<a href="mailto:noelgrandin@gmail.com" target="_blank">noelgrandin@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OpenGrok says that:<br>
<br>
GetDomainName is only used by<br>
GetYPDomainName<br>
in the same file<br>
<br>
which in turn is only used by<br>
const rtl::OUString& SubstitutePathVariables_Impl::GetYPDomainName()<br>
in<br>
/core/framework/source/services/substitutepathvars.cxx<br>
<br>
which in turn is only used by<br>
bool SubstitutePathVariables_Impl::FilterRuleSet( const<br>
SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )<br>
in the same file.<br>
<br>
and that particular codepath in that method is only referenced when the<br>
enum EnvironmentType {<br>
ET_YPDOMAIN<br>
constant is used.<br>
<br>
which in turn is not used anywhere in the LO codebase.<br>
<div><div><br>
<br>
<br>
On Sun, Nov 13, 2011 at 12:06, Tor Lillqvist <<a href="mailto:tml@iki.fi" target="_blank">tml@iki.fi</a>> wrote:<br>
> Seems that the original code was also broken of course, forking and<br>
> execing /bin/domainname is indeed a bit stupid, and the domainname<br>
> command is also specified (to the extent it is "specified" at all) to<br>
> return the NIS domain name.<br>
><br>
> But honestly, how many of the LibreOffice installations on Unix even<br>
> have the NIS domain name set? At least in my openSUSE 11.4 with fairly<br>
> default settings, the domainname command prints nothing. Neither does<br>
> it in my Mac OS X 10.7.2.<br>
><br>
> I guess the sane thing to do here is to 1) unravel the stack of static<br>
> functions in sal/osl/unx/socket.c and find out what public functions<br>
> they actually are used in; 2) if possible drop code that is not<br>
> needed; 3) and finally ponder what will break, if anything, if we just<br>
> don't bother with the NIS domain name. 4) If really necessary, then do<br>
> it right, as Lionel said:<br>
><br>
>> The portable and strictly correct way seems to be to do a<br>
>> DNS query on the result of gethostname() (gethostbyname or getaddrinfo<br>
>> with AI_CANONNAME).<br>
><br>
> But in general we should avoid potentially pointless DNS calls. Let's<br>
> not risk having to wait for DNS timeouts in badly configured<br>
> situations. I think there has been bug reports of OOo and/or LO being<br>
> very slow to start in some cases, where the root cause has been some<br>
> DNS call timing out?<br>
><br>
> LibreOffice is an "office suite", not some Internet service software,<br>
> why would it need to know the exact canonical official hostname of the<br>
> machine it is running on (or some other machine)? Especially as many<br>
> "home" end-user machines certainly don't have any public official DNS<br>
> name anyway, at least not one the machine itself would know, but some<br>
> <a href="http://cable-modem-42651e7a3c.isp.example.com" target="_blank">cable-modem-42651e7a3c.isp.example.com</a>.<br>
><br>
> --tml<br>
</div></div>> _______________________________________________<br>
> LibreOffice mailing list<br>
> <a href="mailto:LibreOffice@lists.freedesktop.org" target="_blank">LibreOffice@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Arnaud Versini<br>