[FreeNX-kNX] FreeNX XDM support A diff - u patch for nxnode
chris at ccburton.com
chris at ccburton.com
Tue Nov 29 15:42:52 UTC 2011
freenx-knx-bounces at kde.org wrote on 28/11/2011 22:03:04:
> Just another note on your patch:
>
> I noticed the following line which is supposed to retrieve the IP
> address of a given hostname:
>
> XDM_HOST_ADDRESS=$(dig +short +search $XDM_HOST|egrep
> "^([0-9]{1,3}[.]){3}[0-9]{1,3}$"|tr "\n" " "|cut -d " " -f1)
>
> I'd suggest to use the following perl 1-liner instead:
>
> XDM_HOST_ADDRESS=
> $(perl -e 'use Socket;@a=gethostbyname shift;print inet_ntoa @a[4];'
> $XDM_HOST)
>
> Advantage: It also resolves names from /etc/hosts (dig, nslookup and
> host all use DNS only). Furthermore, dig, nslookup or host might not be
> available on any system while perl - at least the core - certainly is.
> (e.g: On my Fedora, dig belongs to the bind-utils package)
Oh yes, you're right !!
Resolving using "gethostbyname" is of course how nxagent behaves.
I forget about this because I never use /etc/hosts
I'll send an update . . .
>
> Cheers
> -Fritz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20111129/e8ac5b59/attachment.html>
More information about the FreeNX-kNX
mailing list