[patch] remove reference to HOSTALIASES in hostname(7)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] remove reference to HOSTALIASES in hostname(7)

Hiltjo Posthuma
Hi,

I noticed the man page hostname(7) still references the environment variable
HOSTALIASES. This functionality seems to be removed in the commit:

https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/asr/asr.c?rev=1.50&content-type=text/x-cvsweb-markup

Below is a patch to change it in the man page. I'm not sure about the patch,
maybe it removes too much information?


diff --git share/man/man7/hostname.7 share/man/man7/hostname.7
index 8cacb7f4d72..3842f333b1d 100644
--- share/man/man7/hostname.7
+++ share/man/man7/hostname.7
@@ -30,7 +30,7 @@
 .\"
 .\"     @(#)hostname.7 8.2 (Berkeley) 12/30/93
 .\"
-.Dd $Mdocdate: May 29 2017 $
+.Dd $Mdocdate: Apr 15 2019 $
 .Dt HOSTNAME 7
 .Os
 .Sh NAME
@@ -49,38 +49,6 @@ Hostnames are often used with network client and server programs,
 which must generally translate the name to an address for use.
 (This function is generally performed by the library routine
 .Xr gethostbyname 3 . )
-Hostnames are resolved by the Internet name resolver in the following
-fashion.
-.Pp
-If the name consists of a single component, i.e., contains no dot,
-and if the environment variable
-.Ev HOSTALIASES
-is set to the name of a file,
-that file is searched for any string matching the input hostname.
-The file should consist of lines made up of two whitespace separated strings,
-the first of which is the hostname alias,
-and the second of which is the complete hostname
-to be substituted for that alias.
-If a case-insensitive match is found between the hostname to be resolved
-and the first field of a line in the file, the substituted name is looked
-up with no further processing.
-.Pp
-If the input name ends with a trailing dot,
-the trailing dot is removed,
-and the remaining name is looked up with no further processing.
-.Pp
-If the input name does not end with a trailing dot, it is looked up
-by searching through a list of domains until a match is found.
-The default search list includes first the local domain,
-then its parent domains with at least 2 name components (longest first).
-For example,
-in the domain CS.Berkeley.EDU, the name lithium.CChem will be checked first
-as lithium.CChem.CS.Berkeley.EDU and then as lithium.CChem.Berkeley.EDU.
-Lithium.CChem.EDU will not be tried, as there is only one component
-remaining from the local domain.
-The search path can be changed from the default
-by a system-wide configuration file (see
-.Xr resolv.conf 5 ) .
 .Sh SEE ALSO
 .Xr gethostbyname 3 ,
 .Xr resolv.conf 5 ,

--
Kind regards,
Hiltjo

Reply | Threaded
Open this post in threaded view
|

Re: [patch] remove reference to HOSTALIASES in hostname(7)

Theo de Raadt-2
Your deletion is highly excessive.

Hiltjo Posthuma <[hidden email]> wrote:

> Hi,
>
> I noticed the man page hostname(7) still references the environment variable
> HOSTALIASES. This functionality seems to be removed in the commit:
>
> https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/asr/asr.c?rev=1.50&content-type=text/x-cvsweb-markup
>
> Below is a patch to change it in the man page. I'm not sure about the patch,
> maybe it removes too much information?
>
>
> diff --git share/man/man7/hostname.7 share/man/man7/hostname.7
> index 8cacb7f4d72..3842f333b1d 100644
> --- share/man/man7/hostname.7
> +++ share/man/man7/hostname.7
> @@ -30,7 +30,7 @@
>  .\"
>  .\"     @(#)hostname.7 8.2 (Berkeley) 12/30/93
>  .\"
> -.Dd $Mdocdate: May 29 2017 $
> +.Dd $Mdocdate: Apr 15 2019 $
>  .Dt HOSTNAME 7
>  .Os
>  .Sh NAME
> @@ -49,38 +49,6 @@ Hostnames are often used with network client and server programs,
>  which must generally translate the name to an address for use.
>  (This function is generally performed by the library routine
>  .Xr gethostbyname 3 . )
> -Hostnames are resolved by the Internet name resolver in the following
> -fashion.
> -.Pp
> -If the name consists of a single component, i.e., contains no dot,
> -and if the environment variable
> -.Ev HOSTALIASES
> -is set to the name of a file,
> -that file is searched for any string matching the input hostname.
> -The file should consist of lines made up of two whitespace separated strings,
> -the first of which is the hostname alias,
> -and the second of which is the complete hostname
> -to be substituted for that alias.
> -If a case-insensitive match is found between the hostname to be resolved
> -and the first field of a line in the file, the substituted name is looked
> -up with no further processing.
> -.Pp
> -If the input name ends with a trailing dot,
> -the trailing dot is removed,
> -and the remaining name is looked up with no further processing.
> -.Pp
> -If the input name does not end with a trailing dot, it is looked up
> -by searching through a list of domains until a match is found.
> -The default search list includes first the local domain,
> -then its parent domains with at least 2 name components (longest first).
> -For example,
> -in the domain CS.Berkeley.EDU, the name lithium.CChem will be checked first
> -as lithium.CChem.CS.Berkeley.EDU and then as lithium.CChem.Berkeley.EDU.
> -Lithium.CChem.EDU will not be tried, as there is only one component
> -remaining from the local domain.
> -The search path can be changed from the default
> -by a system-wide configuration file (see
> -.Xr resolv.conf 5 ) .
>  .Sh SEE ALSO
>  .Xr gethostbyname 3 ,
>  .Xr resolv.conf 5 ,
>
> --
> Kind regards,
> Hiltjo
>

Reply | Threaded
Open this post in threaded view
|

Re: [patch] remove reference to HOSTALIASES in hostname(7)

Ingo Schwarze
Hi,

Theo de Raadt wrote on Mon, Apr 15, 2019 at 12:56:35PM -0600:
> Hiltjo Posthuma <[hidden email]> wrote:

>> I noticed the man page hostname(7) still references the environment
>> variable HOSTALIASES.  This functionality seems to be removed in the
>> commit:
>> https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/asr/asr.c?rev=1.50&content-type=text/x-cvsweb-markup

> Your deletion is highly excessive.

I believe the following is the right amount of text to remove.
The description of the file format can go because it does not
appear to be used for anything else.  In particular, hosts(5)
contains its own file format description, which is different.

OK?
  Ingo


Index: hostname.7
===================================================================
RCS file: /cvs/src/share/man/man7/hostname.7,v
retrieving revision 1.10
diff -u -p -r1.10 hostname.7
--- hostname.7 29 May 2017 12:13:50 -0000 1.10
+++ hostname.7 9 May 2019 17:17:47 -0000
@@ -52,19 +52,6 @@ which must generally translate the name
 Hostnames are resolved by the Internet name resolver in the following
 fashion.
 .Pp
-If the name consists of a single component, i.e., contains no dot,
-and if the environment variable
-.Ev HOSTALIASES
-is set to the name of a file,
-that file is searched for any string matching the input hostname.
-The file should consist of lines made up of two whitespace separated strings,
-the first of which is the hostname alias,
-and the second of which is the complete hostname
-to be substituted for that alias.
-If a case-insensitive match is found between the hostname to be resolved
-and the first field of a line in the file, the substituted name is looked
-up with no further processing.
-.Pp
 If the input name ends with a trailing dot,
 the trailing dot is removed,
 and the remaining name is looked up with no further processing.