rpms/util-linux/devel util-linux-2.13-login-ipv6.patch, NONE, 1.1 util-linux-selinux.pamd, 1.5, 1.6 util-linux.spec, 1.128, 1.129

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jul 17 09:10:02 UTC 2006


Author: kzak

Update of /cvs/dist/rpms/util-linux/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv24422

Modified Files:
	util-linux-selinux.pamd util-linux.spec 
Added Files:
	util-linux-2.13-login-ipv6.patch 
Log Message:
add IPv6 and keyring support

util-linux-2.13-login-ipv6.patch:
 login.c |   37 ++++++++++++++++++++++++++++---------
 login.h |    2 +-
 2 files changed, 29 insertions(+), 10 deletions(-)

--- NEW FILE util-linux-2.13-login-ipv6.patch ---
--- util-linux-2.13-pre6/login-utils/login.c.ipv6	2006-07-17 11:05:48.000000000 +0200
+++ util-linux-2.13-pre6/login-utils/login.c	2006-07-17 11:05:48.000000000 +0200
@@ -173,7 +173,7 @@
 #ifdef HAVE_SECURITY_PAM_MISC_H
 static struct passwd pwdcopy;
 #endif
-char    hostaddress[4];		/* used in checktty.c */
+char    hostaddress[16];	/* used in checktty.c */
 char	*hostname;		/* idem */
 static char	*username, *tty_name, *tty_number;
 static char	thishost[100];
@@ -281,7 +281,7 @@
 	if (hostname) {
 		xstrncpy(ut.ut_host, hostname, sizeof(ut.ut_host));
 		if (hostaddress[0])
-			memcpy(&ut.ut_addr, hostaddress, sizeof(ut.ut_addr));
+			memcpy(&ut.ut_addr_v6, hostaddress, sizeof(ut.ut_addr_v6));
 	}
 #if HAVE_UPDWTMP		/* bad luck for ancient systems */
 	updwtmp(_PATH_BTMP, &ut);
@@ -380,13 +380,32 @@
 
 	  hostname = strdup(optarg); 	/* strdup: Ambrose C. Li */
 	  {
-		  struct hostent *he = gethostbyname(hostname);
+		struct addrinfo hints, *addr_info;
+		int k=0;
+		
+		memset(&hints, '\0', sizeof(hints));
+		hints.ai_flags = AI_ADDRCONFIG;
+		
+		if (getaddrinfo(hostname, NULL, &hints, &addr_info) != 0)
+		    fprintf(stderr, "getaddrinfo: %s\n", strerror(errno));
+
+		hostaddress[0] = 0;
 
-		  /* he points to static storage; copy the part we use */
-		  hostaddress[0] = 0;
-		  if (he && he->h_addr_list && he->h_addr_list[0])
-			  memcpy(hostaddress, he->h_addr_list[0],
-				 sizeof(hostaddress));
+		if (addr_info && (addr_info->ai_family == AF_INET))
+		{
+		    struct sockaddr_in *sa4;
+		    
+		    sa4 = (struct sockaddr_in *)addr_info->ai_addr;
+		    memcpy(hostaddress, &(sa4->sin_addr), sizeof(sa4->sin_addr));
+		}
+		if (addr_info && (addr_info->ai_family == AF_INET6))
+		{
+		    struct sockaddr_in6 *sa6;
+		    
+		    sa6 = (struct sockaddr_in6 *)addr_info->ai_addr;
+		    memcpy(hostaddress, &(sa6->sin6_addr), sizeof(sa6->sin6_addr));
+		}
+		freeaddrinfo(addr_info);
 	  }
 	  break;
 	  
@@ -906,7 +925,7 @@
 	if (hostname) {
 		xstrncpy(ut.ut_host, hostname, sizeof(ut.ut_host));
 		if (hostaddress[0])
-			memcpy(&ut.ut_addr, hostaddress, sizeof(ut.ut_addr));
+			memcpy(&ut.ut_addr_v6, hostaddress, sizeof(ut.ut_addr_v6));
 	}
 	
 	pututline(&ut);
--- util-linux-2.13-pre6/login-utils/login.h.ipv6	2005-08-02 14:01:18.000000000 +0200
+++ util-linux-2.13-pre6/login-utils/login.h	2006-07-17 11:05:48.000000000 +0200
@@ -1,7 +1,7 @@
 /* defined in login.c */
 extern void badlogin(const char *s);
 extern void sleepexit(int);
-extern char hostaddress[4];
+extern char hostaddress[16];
 extern char *hostname;
 
 /* defined in checktty.c */


Index: util-linux-selinux.pamd
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux-selinux.pamd,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- util-linux-selinux.pamd	26 Oct 2005 20:30:10 -0000	1.5
+++ util-linux-selinux.pamd	17 Jul 2006 09:09:59 -0000	1.6
@@ -6,6 +6,7 @@
 password   include      system-auth
 # pam_selinux.so close should be the first session rule
 session    required     pam_selinux.so close
+session    optional     pam_keyinit.so force revoke
 session    include      system-auth
 session    required     pam_loginuid.so
 session    optional     pam_console.so


Index: util-linux.spec
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux.spec,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- util-linux.spec	12 Jul 2006 08:39:17 -0000	1.128
+++ util-linux.spec	17 Jul 2006 09:09:59 -0000	1.129
@@ -9,7 +9,7 @@
 Summary: A collection of basic system utilities.
 Name: util-linux
 Version: 2.13
-Release: 0.31.1
+Release: 0.32
 License: distributable
 Group: System Environment/Base
 
@@ -217,6 +217,8 @@
 Patch243: util-linux-2.13-swap-page.patch
 # Don't use linux/posix_types.h or asm/posix_types.h
 Patch244: util-linux-2.13-nfs4-posix_types.patch
+# IPv6 support to login command
+Patch245: util-linux-2.13-login-ipv6.patch
 
 # When adding patches, please make sure that it is easy to find out what bug # the 
 # patch fixes.
@@ -312,6 +314,7 @@
 %patch242 -p1
 %patch243 -p1
 %patch244 -p1
+%patch245 -p1
 
 %build
 unset LINGUAS || :
@@ -702,6 +705,12 @@
 /sbin/losetup
 
 %changelog
+* Mon Jul 17 2006 Karel Zak <kzak at redhat.com> 2.13-0.32
+- add IPv6 support to the login command (patch by Milan Zazrivec)
+
+* Thu Jul 13 2006 David Howells <dhowells at redhat.com>
+- fix #198626 - add keyinit instructions to the login PAM script
+
 * Wed Jul 12 2006 Jesse Keating <jkeating at redhat.com> - 2.13-0.31.1
 - rebuild
 




More information about the fedora-cvs-commits mailing list