[arch-commits] CVS update of arch/build/base/net-tools (3 files)

Jan de Groot jgc at archlinux.org
Fri Apr 27 16:40:14 EDT 2007


    Date: Friday, April 27, 2007 @ 16:40:14
  Author: jgc
    Path: /home/cvs-arch/arch/build/base/net-tools

   Added: net-tools-1.60-nameif.patch (1.1)
          net-tools-1.60-nameif_strncpy.patch (1.1)
Modified: PKGBUILD (1.19 -> 1.20)

upgpkg: net-tools 1.60-11
Add patches to fix possible issues with nameif


-------------------------------------+
 PKGBUILD                            |   22 +++++++----
 net-tools-1.60-nameif.patch         |   67 ++++++++++++++++++++++++++++++++++
 net-tools-1.60-nameif_strncpy.patch |   13 ++++++
 3 files changed, 94 insertions(+), 8 deletions(-)


Index: arch/build/base/net-tools/PKGBUILD
diff -u arch/build/base/net-tools/PKGBUILD:1.19 arch/build/base/net-tools/PKGBUILD:1.20
--- arch/build/base/net-tools/PKGBUILD:1.19	Sun May 14 18:15:09 2006
+++ arch/build/base/net-tools/PKGBUILD	Fri Apr 27 16:40:13 2007
@@ -1,19 +1,23 @@
-# $Id: PKGBUILD,v 1.19 2006/05/14 22:15:09 uid1016 Exp $
+# $Id: PKGBUILD,v 1.20 2007/04/27 20:40:13 jgc Exp $
 # Maintainer: judd <jvinet at zeroflux.org>
 pkgname=net-tools
 pkgver=1.60
-pkgrel=10.1
+pkgrel=11
 pkgdesc="Configuration tools for Linux networking"
 arch=(i686 x86_64)
+license=('GPL')
 url="http://www.tazenda.demon.co.uk/phil/net-tools"
 depends=('glibc')
 backup=('etc/conf.d/nisdomainname')
-source=(http://www.tazenda.demon.co.uk/phil/$pkgname/$pkgname-$pkgver.tar.bz2 \
-  net-tools.patch gcc340.patch net-tools-1.60-2.6-compilefix.patch \
-  net-tools-1.60-miiioctl.patch nisdomainname.conf.d)
-md5sums=('888774accab40217dde927e21979c165' '7ef8d0c6818faa0fdeea94970a20e3fb'\
-         'b52d899cba9956bb0055150506f41ac1' '51de6eabe2d6d6dc860f72c41cee636b'\
-         'c16109863bc63f3dad4ef35305a340bb' 'af3eef5d4837939f7858eec692aa4671')
+source=(http://www.tazenda.demon.co.uk/phil/$pkgname/$pkgname-$pkgver.tar.bz2
+  net-tools.patch gcc340.patch net-tools-1.60-2.6-compilefix.patch
+  net-tools-1.60-miiioctl.patch nisdomainname.conf.d
+  net-tools-1.60-nameif.patch
+  net-tools-1.60-nameif_strncpy.patch)
+md5sums=('888774accab40217dde927e21979c165' '7ef8d0c6818faa0fdeea94970a20e3fb'
+         'b52d899cba9956bb0055150506f41ac1' '51de6eabe2d6d6dc860f72c41cee636b'
+         'c16109863bc63f3dad4ef35305a340bb' 'af3eef5d4837939f7858eec692aa4671'
+         'c4f0653141d6ad69606c78659b8775c9' 'e66466b9304dac85eb42b32f1ec3b284')
 
 build() {
   cd $startdir/src/$pkgname-$pkgver
@@ -22,6 +26,8 @@
   patch -Np1 -i ../net-tools-1.60-2.6-compilefix.patch || return 1
   patch -Np1 -i ../net-tools-1.60-miiioctl.patch || return 1
   patch -Np1 -i ../gcc340.patch || return 1
+  patch -Np1 -i ${startdir}/src/net-tools-1.60-nameif.patch || return 1
+  patch -Np1 -i ${startdir}/src/net-tools-1.60-nameif_strncpy.patch || return 1
   yes "" | make || return 1
   make BASEDIR=$startdir/pkg update
   install -D -m644 ../nisdomainname.conf.d \
Index: arch/build/base/net-tools/net-tools-1.60-nameif.patch
diff -u /dev/null arch/build/base/net-tools/net-tools-1.60-nameif.patch:1.1
--- /dev/null	Fri Apr 27 16:40:14 2007
+++ arch/build/base/net-tools/net-tools-1.60-nameif.patch	Fri Apr 27 16:40:13 2007
@@ -0,0 +1,67 @@
+--- net-tools-1.60/nameif.c.nameif	2000-10-18 19:26:29.000000000 +0200
++++ net-tools-1.60/nameif.c	2003-03-19 11:02:01.000000000 +0100
+@@ -3,7 +3,7 @@
+  * Writen 2000 by Andi Kleen.
+  * Subject to the Gnu Public License, version 2.  
+  * TODO: make it support token ring etc.
+- * $Id: net-tools-1.60-nameif.patch,v 1.1 2007/04/27 20:40:13 jgc Exp $
++ * $Id: net-tools-1.60-nameif.patch,v 1.1 2007/04/27 20:40:13 jgc Exp $
+  */ 
+ #ifndef _GNU_SOURCE 
+ #define _GNU_SOURCE
+@@ -117,7 +117,8 @@
+ }
+ 
+ struct change { 
+-	struct change *next,**pprev;
++	struct change *next;
++	int found;
+ 	char ifname[IFNAMSIZ+1];
+ 	unsigned char mac[6];
+ }; 
+@@ -139,10 +140,7 @@
+ 			ch->ifname, pos); 
+ 	if (parsemac(p,ch->mac) < 0) 
+ 		complain(_("cannot parse MAC `%s' at %s"), p, pos); 
+-	if (clist) 
+-		clist->pprev = &ch->next;
+ 	ch->next = clist;
+-	ch->pprev = &clist;
+ 	clist = ch;
+ 	return 0; 
+ }
+@@ -200,7 +198,7 @@
+ 
+ void usage(void)
+ {
+-	fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}")); 
++	fprintf(stderr, _("usage: nameif [-c configurationfile] [-s] {ifname macaddress}\n")); 
+ 	exit(1); 
+ }
+ 
+@@ -277,21 +275,21 @@
+ 		ch = lookupmac(mac); 
+ 		if (!ch) 
+ 			continue;
+-			
+-		*ch->pprev = ch->next;
++		
++		ch->found = 1;	
+ 		if (strcmp(p, ch->ifname)) { 
+ 			if (setname(p, ch->ifname) < 0)  
+ 				complain(_("cannot change name of %s to %s: %s"),
+ 						p, ch->ifname, strerror(errno)); 
+ 		} 
+-		free(ch);
+ 	} 
+ 	fclose(ifh); 
+ 	
+ 	while (clist) { 
+ 		struct change *ch = clist;
+ 		clist = clist->next;
+-		warning(_("interface '%s' not found"), ch->ifname); 
++		if (!ch->found)
++			warning(_("interface '%s' not found"), ch->ifname); 
+ 		free(ch); 
+ 	}
+ 
Index: arch/build/base/net-tools/net-tools-1.60-nameif_strncpy.patch
diff -u /dev/null arch/build/base/net-tools/net-tools-1.60-nameif_strncpy.patch:1.1
--- /dev/null	Fri Apr 27 16:40:14 2007
+++ arch/build/base/net-tools/net-tools-1.60-nameif_strncpy.patch	Fri Apr 27 16:40:13 2007
@@ -0,0 +1,13 @@
+--- net-tools-1.60/nameif.c.ncpy	2006-10-03 14:24:21.000000000 +0200
++++ net-tools-1.60/nameif.c	2006-10-03 14:22:43.000000000 +0200
+@@ -100,8 +100,8 @@
+ 	struct ifreq ifr;
+ 	opensock(); 
+ 	memset(&ifr,0,sizeof(struct ifreq));
+-	strcpy(ifr.ifr_name, oldname); 
+-	strcpy(ifr.ifr_newname, newname); 
++	strncpy(ifr.ifr_name, oldname, IF_NAMESIZE); 
++	strncpy(ifr.ifr_newname, newname, IF_NAMESIZE); 
+ 	return ioctl(ctl_sk, SIOCSIFNAME, &ifr);
+ }
+ 




More information about the arch-commits mailing list