Bug 746 - ifconfig does something stupid.
ifconfig does something stupid.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: net-tools (Show other bugs)
5.2
All Linux
low Severity low
: ---
: ---
Assigned To: Crutcher Dunnavant
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-01-08 16:44 EST by Peter Jones
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-01-12 09:10:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Jones 1999-01-08 16:44:18 EST
fuzzball:~$ /sbin/ifconfig 1234567890123456
1234567890123456=4`@q?H#: unknown interface.

Here's the diff to fix it:

--- ifconfig.c       Fri Jan  8 16:39:25 1999
+++ ifconfig.c  Fri Jan  8 16:40:44 1999
@@ -496,7 +496,8 @@

   /* No. Fetch the interface name. */
   spp = argv;
-  strncpy(ifr.ifr_name, *spp++, IFNAMSIZ);
+  strncpy(ifr.ifr_name, *spp++, IFNAMSIZ-1);
+  ifr.ifr_name[IFNAMSIZ-1]=0;
   if (*spp == (char *)NULL) {
     if_print(ifr.ifr_name);
     (void) close(skfd);
Comment 1 David Lawrence 1999-01-08 18:14:59 EST
This has been verified to act as the user reports. It is being
assigned to a developer.
Comment 2 Jeff Johnson 1999-01-12 09:10:59 EST
Already fixed in net-tools-1.49-2.

Note You need to log in before you can comment on or make changes to this bug.