rpms/rsh/devel netkit-rsh-0.17-dns.patch, NONE, 1.1 netkit-rsh-0.17-ipv6.patch, 1.1, 1.2 rsh.spec, 1.38, 1.39 netkit-rsh-0.17-nodns.patch, 1.2, NONE netkit-rsh-0.17-nohostcheck.patch, 1.1, NONE

Adam Tkac (atkac) fedora-extras-commits at redhat.com
Mon Oct 15 16:41:04 UTC 2007


Author: atkac

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

Modified Files:
	netkit-rsh-0.17-ipv6.patch rsh.spec 
Added Files:
	netkit-rsh-0.17-dns.patch 
Removed Files:
	netkit-rsh-0.17-nodns.patch netkit-rsh-0.17-nohostcheck.patch 
Log Message:
- removed -D option from rshd and rlogind (we have -a option when
  we need force reverse DNS lookup)
- patches netkit-rsh-0.17-nodns.patch and netkit-rsh-0.17-nohostcheck.patch
  are substituted by netkit-rsh-0.17-dns.patch


netkit-rsh-0.17-dns.patch:

--- NEW FILE netkit-rsh-0.17-dns.patch ---
diff -up netkit-rsh-0.17/rshd/rshd.c.dns netkit-rsh-0.17/rshd/rshd.c
--- netkit-rsh-0.17/rshd/rshd.c.dns	2007-09-27 11:05:26.000000000 +0200
+++ netkit-rsh-0.17/rshd/rshd.c	2007-09-27 11:16:54.000000000 +0200
@@ -294,6 +294,7 @@ static const char *findhostname(struct s
 	char remote_hostname[NI_MAXHOST];
 	struct addrinfo hints;
 	struct addrinfo *res0, *res;
+	int err;
 
 	if (! inet_ntop(fromp->sa_family,
 		(( fromp->sa_family == AF_INET6 )
@@ -305,12 +306,16 @@ static const char *findhostname(struct s
 	    exit(1);
 	}
 
-	if (getnameinfo(fromp, fromlen, remote_hostname, NI_MAXHOST,
-		NULL, 0, 0)) {
-	    syslog(LOG_NOTICE|LOG_AUTH,
-	    	"Failed to retrieve the hostname information for %s",
-	    	remote_address);
-	    exit(1);
+	err = getnameinfo(fromp, fromlen, remote_hostname, NI_MAXHOST,
+		NULL, 0, 0);
+	if (err && (err == EAI_AGAIN) && !check_all)
+		err = getnameinfo (fromp, fromlen, remote_hostname, NI_MAXHOST,
+				   NULL, 0, NI_NUMERICHOST);
+	if (err) {
+		syslog(LOG_NOTICE|LOG_AUTH,
+		       "Failed to retrieve the hostname information for %s",
+		       remote_address);
+		exit(1);
 	}
 
 	errno = ENOMEM; /* malloc (thus strdup) may not set it */
@@ -586,6 +591,11 @@ static void network_init(int fd,
 	error = getnameinfo((struct sockaddr *)fromp, *fromlenp,
 		hostname, sizeof(hostname), portname, sizeof(portname),
 		NI_NUMERICSERV);
+	if (error && (error == EAI_AGAIN) && !check_all)
+		error = getnameinfo ((struct sockaddr *)fromp, *fromlenp,
+				     hostname, sizeof(hostname), portname,
+				     sizeof(portname),
+				     NI_NUMERICSERV|NI_NUMERICHOST);
 	if (error) {
 	    syslog(LOG_NOTICE|LOG_AUTH,
 	    	"Failed to retrieve address and port of the connection: %s",
diff -up netkit-rsh-0.17/rlogind/network.c.dns netkit-rsh-0.17/rlogind/network.c
--- netkit-rsh-0.17/rlogind/network.c.dns	2007-09-27 11:17:07.000000000 +0200
+++ netkit-rsh-0.17/rlogind/network.c	2007-09-27 11:20:29.000000000 +0200
@@ -127,6 +127,10 @@ find_hostname(struct sockaddr *fromp, so
 	error = getnameinfo(fromp, fromlen,
 		hname_buf, sizeof(hname_buf), portname, NI_MAXSERV,
 		NI_NUMERICSERV);
+	if ((error == EAI_AGAIN) && !check_all)
+		error = getnameinfo(fromp, fromlen,
+				    hname_buf, sizeof(hname_buf), portname, NI_MAXSERV,
+				    NI_NUMERICSERV|NI_NUMERICHOST);
 	assert(error == 0);
 
 	if (check_all || local_domain(hname_buf)) {

netkit-rsh-0.17-ipv6.patch:

Index: netkit-rsh-0.17-ipv6.patch
===================================================================
RCS file: /cvs/pkgs/rpms/rsh/devel/netkit-rsh-0.17-ipv6.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- netkit-rsh-0.17-ipv6.patch	17 Jul 2006 12:51:26 -0000	1.1
+++ netkit-rsh-0.17-ipv6.patch	15 Oct 2007 16:41:00 -0000	1.2
@@ -56,9 +56,9 @@
 +}
  
  static char *
--find_hostname(const struct sockaddr_in *fromp, int no_host_check, int *hostokp)
+-find_hostname(const struct sockaddr_in *fromp, int *hostokp)
 +find_hostname(struct sockaddr *fromp, socklen_t fromlen,
-+	char *portname, int no_host_check, int *hostokp)
++	char *portname, int *hostokp)
  {
 -	struct hostent *hop;
 +	int error;
@@ -72,13 +72,13 @@
 -		hname = strdup(inet_ntoa(fromp->sin_addr));
 -		hostok = 1;
 -	} 
--	else if ((check_all || local_domain(hop->h_name )) && !no_host_check ) {
+-	else if (check_all || local_domain(hop->h_name)) {
 +	error = getnameinfo(fromp, fromlen,
 +		hname_buf, sizeof(hname_buf), portname, NI_MAXSERV,
 +		NI_NUMERICSERV);
 +	assert(error == 0);
 +
-+	if ((check_all || local_domain(hname_buf)) && !no_host_check ) {
++	if (check_all || local_domain(hname_buf)) {
  		/*
 -		 * If name returned by gethostbyaddr is in our domain,
 +		 * If name returned is in our domain,
@@ -126,7 +126,7 @@
  	 * where do we go then? We'd have to bail anyhow.
 @@ -145,14 +176,14 @@
  char * 
- network_init(int f, int no_host_check, int *hostokp)
+ network_init(int f, int *hostokp)
  {
 -	struct sockaddr_in from, *fromp;
 +	struct sockaddr_storage from, *fromp;
@@ -145,9 +145,9 @@
  
  	alarm(0);
  
--	hname = find_hostname(fromp,no_host_check, hostokp);
+-	hname = find_hostname(fromp, hostokp);
 +	hname = find_hostname((struct sockaddr *)fromp, fromlen,
-+		portname, no_host_check, hostokp);
++		portname, hostokp);
 +	assert(hname != NULL);
  
 -	port = ntohs(fromp->sin_port);
@@ -220,10 +220,9 @@
  
  	if (hostname==NULL) {
  	    /* out of memory? */
-@@ -309,33 +327,45 @@
+@@ -309,30 +327,42 @@
  	 * Attempt to confirm the DNS. 
  	 */
- 
 -#ifdef	RES_DNSRCH
 -	_res.options &= ~RES_DNSRCH;
 -#endif
@@ -268,8 +267,6 @@
  	syslog(LOG_NOTICE, "Host addr %s not listed for host %s",
 -	       inet_ntoa(fromp->sin_addr), hp->h_name);
 +		remote_address, hostname);
- 	if ( no_host_check == 1 ) 
- 		return hostname;
  	fail("Host address mismatch for %s\n", 
 -	     remuser, inet_ntoa(fromp->sin_addr), locuser, cmdbuf);
 +	     remuser, hostname, locuser, cmdbuf);


Index: rsh.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rsh/devel/rsh.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- rsh.spec	22 Aug 2007 11:41:08 -0000	1.38
+++ rsh.spec	15 Oct 2007 16:41:00 -0000	1.39
@@ -1,7 +1,7 @@
 Summary: Clients for remote access commands (rsh, rlogin, rcp).
 Name: rsh
 Version: 0.17
-Release: 42%{?dist}
+Release: 43%{?dist}
 License: BSD
 Group: Applications/Internet
 
@@ -37,7 +37,6 @@
 Patch15: netkit-rsh-0.17-lfs.patch
 Patch16: netkit-rsh-0.17-chdir.patch
 Patch17: netkit-rsh-0.17-pam-nologin.patch
-Patch18: netkit-rsh-0.17-nohostcheck.patch
 Patch19: netkit-rsh-0.17-rexec-netrc.patch
 Patch20: netkit-rsh-0.17-pam-sess.patch
 Patch21: netkit-rsh-0.17-errno.patch
@@ -51,7 +50,7 @@
 Patch29: netkit-rsh-0.17-rlogin-linefeed.patch
 Patch30: netkit-rsh-0.17-ipv6.patch
 Patch31: netkit-rsh-0.17-pam_env.patch
-Patch32: netkit-rsh-0.17-nodns.patch
+Patch33: netkit-rsh-0.17-dns.patch
 
 %description
 The rsh package contains a set of programs which allow users to run
@@ -101,7 +100,6 @@
 %patch15 -p1 -b .lfs
 %patch16 -p1 -b .chdir
 %patch17 -p1 -b .pam-nologin
-%patch18 -p1 -b .nohostcheck
 %patch19 -p1 -b .rexec-netrc
 %patch20 -p1 -b .pam-sess
 %patch21 -p1 -b .errno
@@ -115,7 +113,7 @@
 %patch29 -p1 -b .linefeed
 %patch30 -p1 -b .ipv6
 %patch31 -p1 -b .pam_env
-%patch32 -p1 -b .nodns
+%patch33 -p1 -b .dns
 
 # No, I don't know what this is doing in the tarball.
 rm -f rexec/rexec
@@ -184,6 +182,12 @@
 %{_mandir}/man8/*.8*
 
 %changelog
+* Thu Sep 27 2007 Adam Tkac <atkac redhat com> 0.17-43
+- removed -D option from rshd and rlogind (we have -a option when
+  we need force reverse DNS lookup)
+- patches netkit-rsh-0.17-nodns.patch and netkit-rsh-0.17-nohostcheck.patch
+  are substituted by netkit-rsh-0.17-dns.patch
+
 * Wed Aug 22 2007 Adam Tkac <atkac redhat com> 0.17-42
 - rebuild (BuildID feature)
 


--- netkit-rsh-0.17-nodns.patch DELETED ---


--- netkit-rsh-0.17-nohostcheck.patch DELETED ---




More information about the fedora-extras-commits mailing list