Tim Rice
2021-Feb-05 18:02 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
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
Darren Tucker
2021-Feb-05 21:59 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
On Sat, 6 Feb 2021 at 05:12, Tim Rice <tim at multitalents.net> wrote: [...]> tim at server01-UnixWare 69% hostname > server01.int.multitalents.netSigh. I was wondering if that was going to bite me, but it was OK on all of the systems I checked. I'll roll it back and add a hostname function in test-exec.sh similar to the one for egrep which should also fix the original problem (which was that some platforms don't have hostname these days). -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new) Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Bob Proulx
2021-Feb-07 22:43 UTC
[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
Tim Rice wrote:> > -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 > ....I'll just note that on Debian, Ubuntu, other derivatives (such as Mint, Trisquel...) both the "uname -n" and "hostname" values would typically be just the short name. It's not just UnixWare... rwp at havoc:~$ uname -n havoc rwp at havoc:~$ hostname havoc Getting a FQDN is truly not trivial. :-( Bob