bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] dnsdomainname, domainname, nisdomainname, ypdomainna


From: Simon Josefsson
Subject: Re: [bug-inetutils] dnsdomainname, domainname, nisdomainname, ypdomainname
Date: Mon, 12 Mar 2012 09:35:10 +0100
User-agent: Gnus/5.130003 (Ma Gnus v0.3) Emacs/24.0.94 (gnu/linux)

address@hidden (Alfred M. Szmidt) writes:

>    After looking at Debian's 'dnsdomainname' tool and reading its man
>    page, I believe that sharing code with InetUtils hostname.c make no
>    sense.  None of the other parameters applies to that tool, and they
>    would only be confusing.  Thus here is a completely new tool.  What
>    do you think?  Please review and we can hopefully work towards
>    pushing this eventually.
>
> Regarding the option names, is there anything similar on BSD?  Are the
> option names different there?

I don't have access to any BSD boxes.  Mats, can you help here?  Just
'man dnsdomainname' or 'dnsdomainname -h' would help.

FWIW, I checked Solaris and it doesn't have 'dnsdomainname',
'nisdomainname', or 'ypdomainname'.  It has domainname though:

     domainname [name-of-domain]

It doesn't seem to accept any kind of -h switches at all.  It shows or
sets the NIS domain name:

SYNOPSIS
     domainname [name-of-domain]

DESCRIPTION
     Without an argument, domainname displays  the  name  of  the
     current  domain name used in RPC exchanges, usually referred
     to as the NIS domain name. This name typically encompasses a

>    One thing that strikes me is that possibly the tool should fail rather
>    than printing "(none)".
>
> What happens on Debian?

If I'm reading the code properly, the tool will fail with an error.  The
only use of '(none)' in their code is in a strcmp, presumably as a
left-over from older times where the code did fall back to '(none)'
instead of failing.

>    Another idea is that it should use getaddrinfo
>    instead of gethostbyname.  Thoughts?
>
> No strong opinion, Mats has been replacing gethostbyname usage with
> getaddrinfo anyway.  Using the same type of code all over the place
> makes sense.

I agree

> Maybe a small test case?

Of course.

>    +      return EXIT_SUCCESS;
>
> exit (EXIT_SUCCESS); please.

Sure.

I'll prepare an updated version of the patch.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]