commit telnet for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package telnet for openSUSE:Factory checked in at Mon May 25 17:26:38 CEST 2009. -------- --- telnet/telnet.changes 2008-08-30 20:16:03.000000000 +0200 +++ /mounts/work_src_done/STABLE/telnet/telnet.changes 2009-05-22 14:37:08.000000000 +0200 @@ -1,0 +2,5 @@ +Fri May 22 14:18:35 CEST 2009 - crrodriguez@suse.de + +- do not use gethostbyname(3) but getaddrinfo(3) patch by Ulrich Drepper. + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- telnet-bsd-1.2-no_gethostbyname.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ telnet.spec ++++++ --- /var/tmp/diff_new_pack.K28256/_old 2009-05-25 17:26:08.000000000 +0200 +++ /var/tmp/diff_new_pack.K28256/_new 2009-05-25 17:26:08.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package telnet (Version 1.2) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ Provides: nkitb:/usr/bin/telnet AutoReqProv: on Version: 1.2 -Release: 134 +Release: 141 Summary: A client program for the telnet remote login protocol BuildRequires: ncurses-devel Requires: netcfg @@ -34,6 +34,7 @@ Source2: telnet.firewall Patch1: %{name}-bsd-1.2-suppress_hostname.patch Patch2: %{name}-bsd-%{version}-man-page.patch +Patch3: telnet-bsd-1.2-no_gethostbyname.patch %description Telnet is an old protocol for logging into remote systems. It is @@ -66,6 +67,7 @@ %setup -q -n telnet-bsd-%version %patch1 -p1 %patch2 +%patch3 %build export CFLAGS="$RPM_OPT_FLAGS -fpie $(ncurses5-config --cflags)" @@ -106,6 +108,8 @@ %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}-server %changelog +* Fri May 22 2009 crrodriguez@suse.de +- do not use gethostbyname(3) but getaddrinfo(3) patch by Ulrich Drepper. * Sat Aug 30 2008 cthiel@suse.de - fix build with latests ncurses * Wed Apr 09 2008 jsrain@suse.cz ++++++ telnet-bsd-1.2-no_gethostbyname.patch ++++++ Index: telnet/commands.c =================================================================== --- telnet/commands.c.orig 2005-06-02 10:12:51.000000000 +0200 +++ telnet/commands.c 2009-05-22 01:27:21.108685000 +0200 @@ -1850,9 +1850,16 @@ env_init (void) /* If this is not the full name, try to get it via DNS */ if (strchr (hbuf, '.') == 0) { - struct hostent *he = gethostbyname (hbuf); - if (he != 0) - strncpy (hbuf, he->h_name, sizeof hbuf - 1); + struct addrinfo hints; + struct addrinfo *res; + memset (&hints, '\0', sizeof (hints)); + hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_CANONNAME; + if (getaddrinfo (hbuf, NULL, &hints, &res) == 0) { + if (res->ai_canonname != NULL) + strncpy(hbuf, res->ai_canonname, sizeof hbuf-1); + freeaddrinfo (res); + } + hbuf[sizeof hbuf - 1] = '\0'; } @@ -2919,19 +2926,16 @@ sourceroute (char *arg, char **cpp, int } if (!c) cp2 = 0; + struct addrinfo hints; + memset (&hints, '\0', sizeof (hints)); + // XXX The code here seems to allow only IPv4 addresses. + hints.ai_family = AF_INET; + hints.ai_flags = AI_ADDRCONFIG; + struct addrinfo *aires; + if (getaddrinfo (cp, NULL, &hints, &aires) == 0) { + sin_addr = ((struct sockaddr_in *) aires->ai_addr)->sin_addr; + freeaddrinfo (aires); - if ((tmp = inet_addr (cp)) != -1) - { - sin_addr.s_addr = tmp; - } - else if ((host = gethostbyname (cp))) - { -#if defined(h_addr) - memmove ((caddr_t) & sin_addr, - host->h_addr_list[0], sizeof (sin_addr)); -#else - memmove ((caddr_t) & sin_addr, host->h_addr, sizeof (sin_addr)); -#endif } else { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de