strncpy patch for nameif

This commit is contained in:
Radek Vokál 2006-10-03 12:29:53 +00:00
parent 57e1edd1d3
commit 3383925548
2 changed files with 15 additions and 0 deletions

View File

@ -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);
}

View File

@ -69,6 +69,7 @@ Patch54: net-tools-1.60-ifconfig-long-iface-crasher.patch
Patch55: net-tools-1.60-netdevice.patch
Patch56: net-tools-1.60-skip.patch
Patch57: net-tools-1.60-netstat-I-fix.patch
Patch58: net-tools-1.60-nameif_strncpy.patch
BuildRoot: %{_tmppath}/%{name}-root
Requires(post,preun): chkconfig
@ -135,6 +136,7 @@ ifconfig, netstat, route, and others.
%patch55 -p1 -b .netdevice
%patch56 -p1 -b .skip
%patch57 -p1
%patch58 -p1 -b .strncpy
cp %SOURCE2 ./config.h
cp %SOURCE3 ./config.make