Commit d945b816cf3c37a2f581fbddaa9c1b4283ffc861

Authored by perry.werneck@gmail.com
1 parent b789758e

rpmlint estava reclamando do uso de gethostbyname

src/lib3270/proxy.c
... ... @@ -516,8 +516,13 @@ proxy_telnet(int fd, char *host, unsigned short port)
516 516 }
517 517  
518 518 /* SOCKS version 4 proxy. */
519   -static int
520   -proxy_socks4(int fd, char *host, unsigned short port, int force_a)
  519 +#if defined(HAVE_GETADDRINFO)
  520 +static int proxy_socks4(int fd, char *host, unsigned short port, int force_a)
  521 +{
  522 + popup_an_error(NULL,"%s", _( "Unsupported socks 4 proxy" ) );
  523 +}
  524 +#else
  525 +static int proxy_socks4(int fd, char *host, unsigned short port, int force_a)
521 526 {
522 527 struct hostent *hp;
523 528 struct in_addr ipaddr;
... ... @@ -673,6 +678,7 @@ proxy_socks4(int fd, char *host, unsigned short port, int force_a)
673 678  
674 679 return 0;
675 680 }
  681 +#endif // HAVE_GETADDRINFO
676 682  
677 683 /* SOCKS version 5 (RFC 1928) proxy. */
678 684 static int
... ...
src/lib3270/resolver.c
... ... @@ -129,7 +129,7 @@ static int cresolve_host_and_port(H3270 *h, struct parms *p)
129 129  
130 130 freeaddrinfo(res);
131 131  
132   -#else /*][*/
  132 +#else
133 133  
134 134 struct hostent *hp;
135 135 struct servent *sp;
... ... @@ -175,7 +175,7 @@ static int cresolve_host_and_port(H3270 *h, struct parms *p)
175 175 sin->sin_port = port;
176 176 *p->sa_len = sizeof(struct sockaddr_in);
177 177  
178   -#endif
  178 +#endif // HAVE_GETADDRINFO
179 179  
180 180 return 0;
181 181 }
... ...
src/lib3270/rpq.c
... ... @@ -604,7 +604,7 @@ get_rpq_address(unsigned char *buf, const int maxlen)
604 604 }
605 605 *p2 = '\0';
606 606  
607   -#if defined(AF_INET6) /*[*/
  607 +#if defined(HAVE_GETADDRINFO)
608 608 ga_err = getaddrinfo(rpqtext, NULL, NULL, &res);
609 609 if (ga_err == 0) {
610 610 void *src = NULL;
... ... @@ -623,8 +623,7 @@ get_rpq_address(unsigned char *buf, const int maxlen)
623 623 len = sizeof(struct in6_addr);
624 624 break;
625 625 default:
626   - rpq_warning("RPQ ADDRESS term has unrecognized family %u",
627   - res->ai_family);
  626 + rpq_warning("RPQ ADDRESS term has unrecognized family %u",res->ai_family);
628 627 break;
629 628 }
630 629  
... ... @@ -663,16 +662,16 @@ get_rpq_address(unsigned char *buf, const int maxlen)
663 662 } else {
664 663 rpq_warning("RPQ ADDRESS term incomplete due to space limit");
665 664 }
666   -#endif /*]*/
  665 +#endif // HAVE_GETADDRINFO
667 666 free(rpqtext);
668 667 } else {
669 668 /* No override... get our address from the actual socket */
670 669 union {
671 670 struct sockaddr sa;
672 671 struct sockaddr_in sa4;
673   -#if defined(AF_INET6) /*[*/
  672 +#if defined(HAVE_GETADDRINFO)
674 673 struct sockaddr_in6 sa6;
675   -#endif /*]*/
  674 +#endif // HAVE_GETADDRINFO
676 675 } u;
677 676 int addrlen = sizeof(u);
678 677 void *src = NULL;
... ... @@ -687,12 +686,12 @@ get_rpq_address(unsigned char *buf, const int maxlen)
687 686 src = &u.sa4.sin_addr;
688 687 len = sizeof(struct in_addr);
689 688 break;
690   -#if defined(AF_INET6) /*[*/
  689 +#if defined(HAVE_GETADDRINFO)
691 690 case AF_INET6:
692 691 src = &u.sa6.sin6_addr;
693 692 len = sizeof(struct in6_addr);
694 693 break;
695   -#endif /*]*/
  694 +#endif // HAVE_GETADDRINFO
696 695 default:
697 696 rpq_warning("RPQ ADDRESS term has unrecognized family %u", u.sa.sa_family);
698 697 break;
... ...
src/lib3270/telnet.c
... ... @@ -491,8 +491,8 @@ static int connect_sock(H3270 *hSession, int sockfd, const struct sockaddr *addr
491 491 */
492 492 int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Boolean *resolving, Boolean *pending)
493 493 {
494   - struct servent * sp;
495   - struct hostent * hp;
  494 +// struct servent * sp;
  495 +// struct hostent * hp;
496 496 char passthru_haddr[8];
497 497 int passthru_len = 0;
498 498 unsigned short passthru_port = 0;
... ... @@ -548,21 +548,27 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo
548 548 /* get the passthru host and port number */
549 549 if (session->passthru_host)
550 550 {
551   - const char *hn = CN;
  551 +#if defined(HAVE_GETADDRINFO)
  552 +
  553 + popup_an_error(session,"%s",_( "Unsupported passthru host session" ) );
  554 +
  555 +#else
  556 + struct hostent * hp = NULL;
  557 + struct servent * sp = NULL;
  558 + const char * hn = CN;
552 559  
553   -#ifndef ANDROID
554 560 hn = getenv("INTERNET_HOST");
555   -#endif // ANDROID
556 561  
557 562 if (hn == CN)
558 563 hn = "internet-gateway";
559 564  
560 565 hp = gethostbyname(hn);
561   - if (hp == (struct hostent *) 0) {
562   - popup_an_error(NULL,"Unknown passthru host: %s", hn);
  566 + if (hp == (struct hostent *) 0)
  567 + {
  568 + popup_an_error(session,_( "Unknown passthru host: %s" ), hn);
563 569 return -1;
564 570 }
565   - (void) memmove(passthru_haddr, hp->h_addr, hp->h_length);
  571 + memmove(passthru_haddr, hp->h_addr, hp->h_length);
566 572 passthru_len = hp->h_length;
567 573  
568 574 sp = getservbyname("telnet-passthru","tcp");
... ... @@ -570,6 +576,8 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo
570 576 passthru_port = sp->s_port;
571 577 else
572 578 passthru_port = htons(3514);
  579 +
  580 +#endif // HAVE_GETADDRINFO
573 581 }
574 582 else if(session->proxy != CN && !proxy_type)
575 583 {
... ...
ui/99debug.xml
... ... @@ -16,8 +16,8 @@
16 16 obter mais detalhes.
17 17  
18 18 Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
19   - programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
20   - Place, Suite 330, Boston, MA, 02111-1307, USA
  19 + programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  20 + St, Fifth Floor, Boston, MA 02110-1301 USA
21 21  
22 22 Contatos:
23 23  
... ...