[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use

Tim Rice tim at multitalents.net
Sat Feb 6 05:02:42 AEDT 2021


On Fri, 5 Feb 2021, git+noreply at mindrot.org wrote:

> commit b446c214279de50ed8388e54897eb1be5281c894
> Author: dtucker at openbsd.org <dtucker at openbsd.org>
> Date:   Fri Feb 5 06:01:58 2021 +0000

>     upstream: hostname is not specified by POSIX but uname -n is, so use
>     the latter for portability.  Patch from Geert Hendrickx via github PR#208.

> diff --git a/regress/percent.sh b/regress/percent.sh
> index 28781117..e39f0696 100644
> --- a/regress/percent.sh
> +++ b/regress/percent.sh

> @@ -10,8 +10,8 @@ fi
>  
>  USER=`id -u -n`
>  USERID=`id -u`
> -HOST=`hostname | cut -f1 -d.`
> -HOSTNAME=`hostname`
> +HOST=`uname -n | cut -f1 -d.`
> +HOSTNAME=`uname -n`

This may not work as intended.
....
tim at server01-UnixWare 69% hostname
server01.int.multitalents.net
tim at server01-UnixWare 70% uname -n
server01
....

-- 
Tim Rice				Multitalents
tim at multitalents.net




More information about the openssh-unix-dev mailing list