rpms/telnet/devel netkit-telnet-0.17-nodns.patch, 1.1, 1.2 telnet.spec, 1.31, 1.32

Adam Tkac (atkac) fedora-extras-commits at redhat.com
Tue Sep 25 12:07:53 UTC 2007


Author: atkac

Update of /cvs/pkgs/rpms/telnet/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22403

Modified Files:
	netkit-telnet-0.17-nodns.patch telnet.spec 
Log Message:
- rebased "nodns" patch with patch from Bryn M. Reeves


netkit-telnet-0.17-nodns.patch:

Index: netkit-telnet-0.17-nodns.patch
===================================================================
RCS file: /cvs/pkgs/rpms/telnet/devel/netkit-telnet-0.17-nodns.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- netkit-telnet-0.17-nodns.patch	13 Apr 2007 12:29:34 -0000	1.1
+++ netkit-telnet-0.17-nodns.patch	25 Sep 2007 12:07:51 -0000	1.2
@@ -1,63 +1,43 @@
---- netkit-telnet-0.17/telnetd/telnetd.8.nodns	2000-07-31 01:57:10.000000000 +0200
-+++ netkit-telnet-0.17/telnetd/telnetd.8	2007-04-13 10:58:27.000000000 +0200
-@@ -123,6 +123,8 @@
- .Xr login 1
- program.
- .El
-+.It Fl c
-+This option disables reverse dns checking. Of course that security is lower with this option
- .It Fl D Ar debugmode
- This option may be used for debugging purposes.  This allows
- .Nm telnetd
---- netkit-telnet-0.17/telnetd/telnetd.c.nodns	2007-04-13 10:49:57.000000000 +0200
-+++ netkit-telnet-0.17/telnetd/telnetd.c	2007-04-13 10:49:57.000000000 +0200
-@@ -83,6 +83,7 @@
- 
- int debug = 0;
- int keepalive = 1;
-+int nodns = 0;
- char *loginprg = _PATH_LOGIN;
- char *progname;
- 
-@@ -111,7 +112,7 @@
- 
- 	progname = *argv;
- 
--	while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) {
-+	while ((ch = getopt(argc, argv, "cd:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) {
- 		switch(ch) {
- 
- #ifdef	AUTHENTICATE
-@@ -147,7 +148,9 @@
- 			bftpd++;
- 			break;
- #endif /* BFTPDAEMON */
--
-+		case 'c':
-+			nodns++;
-+			break;
- 		case 'd':
- 			if (strcmp(optarg, "ebug") == 0) {
- 				debug++;
-@@ -652,6 +655,9 @@
- 	char namebuf[255];
+--- netkit-telnet-0.17.orig/telnetd/telnetd.c	2007-03-13 16:31:20.000000000 +0000
++++ netkit-telnet-0.17.orig/telnetd/telnetd.c	2007-03-13 16:31:26.000000000 +0000
+@@ -653,6 +653,11 @@ doit(struct sockaddr *who, socklen_t who
  
  	error = getnameinfo(who, wholen, namebuf, sizeof(namebuf), NULL, 0, 0);
-+
-+	if ((error == EAI_AGAIN) && nodns)
-+		error = getnameinfo(who, wholen, namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
  	
++	/* if we can't get a hostname now, settle for an address */	
++	if(error == EAI_AGAIN)
++		error = getnameinfo(who, wholen, namebuf, sizeof(namebuf),
++				NULL, 0, NI_NUMERICHOST);
++		
  	if (error) {
  		perror("getnameinfo: localhost");
-@@ -688,7 +694,10 @@
- 		hints.ai_socktype = SOCK_STREAM;
- 		hints.ai_flags = AI_ADDRCONFIG;
+ 		perror(gai_strerror(error));
+@@ -681,7 +686,7 @@ doit(struct sockaddr *who, socklen_t who
+ 	/* Get local host name */
+ 	{
+ 		struct addrinfo hints;
+-		struct addrinfo *res;
++		struct addrinfo *res = 0;
+ 		int e;
+ 
+ 		memset(&hints, '\0', sizeof(hints));
+@@ -690,11 +695,14 @@ doit(struct sockaddr *who, socklen_t who
  
--		gethostname(host_name, sizeof(host_name));
-+		if(nodns)
-+			sprintf(host_name, "localhost", sizeof(host_name));
-+		else
-+			gethostname(host_name, sizeof(host_name));
+ 		gethostname(host_name, sizeof(host_name));
  		if ((e = getaddrinfo(host_name, NULL, &hints, &res)) != 0) {
- 			perror("getaddrinfo: localhost");
- 			perror(gai_strerror(e));
+-			perror("getaddrinfo: localhost");
+-			perror(gai_strerror(e));
+-			exit(1);
++			if(e != EAI_AGAIN) {
++				fprintf(stderr, "getaddrinfo: localhost %s\n", 
++				        gai_strerror(e));
++				exit(1);
++			}
+ 		}
+-		freeaddrinfo(res);
++		if(res)
++			freeaddrinfo(res);
+ 	}
+ 
+ #if	defined(AUTHENTICATE) || defined(ENCRYPT)
+


Index: telnet.spec
===================================================================
RCS file: /cvs/pkgs/rpms/telnet/devel/telnet.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- telnet.spec	20 Sep 2007 09:19:07 -0000	1.31
+++ telnet.spec	25 Sep 2007 12:07:51 -0000	1.32
@@ -1,7 +1,7 @@
 Summary: The client program for the telnet remote login protocol.
 Name: telnet
 Version: 0.17
-Release: 40%{?dist}
+Release: 41%{?dist}
 Epoch: 1
 License: BSD
 Group: Applications/Internet
@@ -135,6 +135,9 @@
 %{_mandir}/man8/telnetd.8*
 
 %changelog
+* Tue Sep 25 2007 Adam Tkac <atkac redhat com> 1:0.17-41
+- rebased "nodns" patch with patch from Bryn M. Reeves
+
 * Thu Sep 20 2007 Adam Tkac <atkac redhat com> 1:0.17-40
 - improved patch to #274991
 




More information about the scm-commits mailing list