Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


OpenGrok says that:

GetDomainName is only used by
  GetYPDomainName
in the same file

which in turn is only used by
 const rtl::OUString& SubstitutePathVariables_Impl::GetYPDomainName()
in
  /core/framework/source/services/substitutepathvars.cxx

which in turn is only used by
  bool SubstitutePathVariables_Impl::FilterRuleSet( const
SubstituteRuleVector& aRuleSet, SubstituteRule& aActiveRule )
in the same file.

and that particular codepath in that method is only referenced when the
  enum EnvironmentType {
      ET_YPDOMAIN
constant is used.

which in turn is not used anywhere in the LO codebase.



On Sun, Nov 13, 2011 at 12:06, Tor Lillqvist <tml@iki.fi> wrote:
Seems that the original code was also broken of course, forking and
execing /bin/domainname is indeed a bit stupid, and the domainname
command is also specified (to the extent it is "specified" at all) to
return the NIS domain name.

But honestly, how many of the LibreOffice installations on Unix even
have the NIS domain name set? At least in my openSUSE 11.4 with fairly
default settings, the domainname command prints nothing. Neither does
it in my Mac OS X 10.7.2.

I guess the sane thing to do here is to 1) unravel the stack of static
functions in sal/osl/unx/socket.c and find out what public functions
they actually are used in; 2) if possible drop code that is not
needed; 3) and finally ponder what will break, if anything, if we just
don't bother with the NIS domain name. 4) If really necessary, then do
it right, as Lionel said:

The portable and strictly correct way seems to be to do a
DNS query on the result of gethostname() (gethostbyname or getaddrinfo
with AI_CANONNAME).

But in general we should avoid potentially pointless DNS calls. Let's
not risk having to wait for DNS timeouts in badly configured
situations. I think there has been bug reports of OOo and/or LO being
very slow to start in some cases, where the root cause has been some
DNS call timing out?

LibreOffice is an "office suite", not some Internet service software,
why would it need to know the exact canonical official hostname of the
machine it is running on (or some other machine)? Especially as many
"home" end-user machines certainly don't have any public official DNS
name anyway, at least not one the machine itself would know, but some
cable-modem-42651e7a3c.isp.example.com.

--tml
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.