Commit 6ff46145 authored by Martina Ferrari's avatar Martina Ferrari

Remove even more patches.

parent 24d59ab0
--- a/netstat.c
+++ b/netstat.c
@@ -86,6 +86,8 @@
#include <sys/ioctl.h>
@@ -88,6 +88,7 @@
#include <sys/stat.h>
#include <net/if.h>
#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "net-support.h"
......
Patch by Antonio Galea <ant9000@netwise.it> to solve the socket number overflow
from #345331
--- a/netstat.c
+++ b/netstat.c
@@ -317,8 +317,8 @@
strncpy(inode_str, lname+PRG_SOCKET_PFXl, inode_str_len);
inode_str[inode_str_len] = '\0';
- *inode_p = strtol(inode_str,&serr,0);
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+ *inode_p = strtoul(inode_str,&serr,0);
+ if (!serr || *serr)
return(-1);
}
return(0);
@@ -338,8 +338,8 @@
{
char *serr;
- *inode_p=strtol(lname + PRG_SOCKET_PFX2l,&serr,0);
- if (!serr || *serr || *inode_p < 0 || *inode_p >= INT_MAX)
+ *inode_p=strtoul(lname + PRG_SOCKET_PFX2l,&serr,0);
+ if (!serr || *serr)
return(-1);
}
return(0);
......@@ -4,7 +4,7 @@ Bug-Debian: http://bugs.debian.org/443075
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -658,14 +658,14 @@
@@ -643,14 +643,14 @@
spp++;
continue;
}
......@@ -12,7 +12,7 @@ Bug-Debian: http://bugs.debian.org/443075
+ if (!strcmp(*spp, "-pointopoint") || !strcmp(*spp, "-pointtopoint")) {
goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
spp++;
if (test_flag(ifr.ifr_name, IFF_MULTICAST) > 0)
if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0)
fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
continue;
}
......
......@@ -4,7 +4,7 @@ Bug-Debian: http://bugs.debian.org/500913
--- a/man/en_US/route.8
+++ b/man/en_US/route.8
@@ -195,6 +195,12 @@
@@ -205,6 +205,12 @@
in the destination field of the current routing table.
.TP
......@@ -14,6 +14,6 @@ Bug-Debian: http://bugs.debian.org/500913
+same as as seen in 'route -n' listing.
+
+.TP
.B route add default gw mango\-gw
.B route add default gw mango
adds a default route (which will be used if no other route matches).
All packets using this route will be gatewayed through "mango\-gw". The
All packets using this route will be gatewayed through the address of a node
Description: Properly initialise sin6 fields. Copied from upstream CVS: http://cvs.berlios.de/cgi-bin/viewvc.cgi/net-tools/net-tools/lib/inet6.c?r1=1.12&r2=1.13
Author: Bernd Eckenfels <net-tools@lina.inka.de>
Bug-Debian: http://bugs.debian.org/508110
Index: net-tools/lib/inet6.c
===================================================================
--- net-tools.orig/lib/inet6.c
+++ net-tools/lib/inet6.c
@@ -3,7 +3,7 @@
* support functions for the net-tools.
* (most of it copied from lib/inet.c 1.26).
*
- * Version: $Id: inet6.c,v 1.12 2002/12/10 01:03:09 ecki Exp $
+ * Version: $Id: inet6.c,v 1.13 2010/07/05 22:52:00 ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* Copyright 1993 MicroWalt Corporation
@@ -157,12 +157,14 @@ static int INET6_getsock(char *bufp, str
sin6 = (struct sockaddr_in6 *) sap;
sin6->sin6_family = AF_INET6;
sin6->sin6_port = 0;
+ sin6->sin6_scope_id = 0;
+ sin6->sin6_flowinfo = 0;
if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
return (-1);
- p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
+ p = fix_v4_address(bufp, &sin6->sin6_addr);
+ if (p != bufp)
+ memcpy(bufp, p, strlen(p)+1);
return 16; /* ?;) */
}
Author: Olaf <olaf.westrik@gmx.net>
Description: mii-tool: scan all ethernet devices instead of eth[0-7].
Bug-Debian: http://bugs.debian.org/532879
--- a/Makefile
+++ b/Makefile
@@ -218,7 +218,7 @@
$(CC) $(LDFLAGS) -o ipmaddr ipmaddr.o $(NLIB) $(RESLIB)
mii-tool: mii-tool.o
- $(CC) $(LDFLAGS) -o mii-tool mii-tool.o
+ $(CC) $(LDFLAGS) -o mii-tool mii-tool.o $(NLIB)
installbin:
install -m 0755 -d ${BASEDIR}/sbin
--- a/mii-tool.c
+++ b/mii-tool.c
@@ -31,6 +31,8 @@
static char Version[] = "$Id: mii-tool.c,v 1.9 2006/09/27 20:59:18 ecki Exp $\n(Author: David Hinds based on Donald Becker's mii-diag)";
+#include "config.h"
+
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -45,6 +47,7 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <linux/sockios.h>
#ifndef __GLIBC__
@@ -54,6 +57,9 @@
#include "mii.h"
#include "version.h"
+#include "interface.h"
+#include "sockets.h"
+
#define MAX_ETH 8 /* Maximum # of interfaces */
/* Table of known MII's */
@@ -109,8 +115,6 @@
static int nway_advertise = 0;
static int fixed_speed = 0;
static int override_phy = -1;
-
-static int skfd = -1; /* AF_INET socket for ioctl() calls. */
static struct ifreq ifr;
/*--------------------------------------------------------------------*/
@@ -409,6 +413,19 @@
/*--------------------------------------------------------------------*/
+int do_mii_print(struct interface *ife, void *cookie)
+{
+ int res;
+
+ res = do_if_fetch(ife);
+ if ((res >= 0) && (ife->type == ARPHRD_ETHER)) {
+ do_one_xcvr(skfd, ife->name, 1);
+ }
+ return res;
+}
+
+/*--------------------------------------------------------------------*/
+
const char *usage =
"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
" -V, --version display version information\n"
@@ -477,11 +494,16 @@
/* No remaining args means show all interfaces. */
if (optind == argc) {
+ int opt_a = 1;
ret = 1;
- for (i = 0; i < MAX_ETH; i++) {
- sprintf(s, "eth%d", i);
- ret &= do_one_xcvr(skfd, s, 1);
+ /* Create a channel to the NET kernel. */
+ if ((skfd = sockets_open(0)) < 0) {
+ perror("socket");
+ exit(1);
}
+ ret = for_all_interfaces(do_mii_print, &opt_a);
+ (void) close(skfd);
+
if (ret)
fprintf(stderr, "no MII interfaces found\n");
} else {
--- a/netstat.c
+++ b/netstat.c
@@ -1742,6 +1742,7 @@
parsesnmp(flag_raw, flag_tcp, flag_udp);
@@ -2201,12 +2201,14 @@
parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
#else
ENOSUPP("netstat", "AF INET");
+ exit(1);
#endif
} else if(!strcmp(afname, "inet6")) {
#if HAVE_AFINET6
@@ -1749,6 +1750,7 @@
parsesnmp6(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET6");
......
Description: do not crash if an inappropriately long argument is used for -D.
Author: Kees Cook <kees@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/net-tools/+bug/515010
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569509
--- a/arp.c
+++ b/arp.c
@@ -243,7 +243,8 @@
struct ifreq ifr;
struct hwtype *xhw;
- strcpy(ifr.ifr_name, ifname);
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ ifr.ifr_name[IFNAMSIZ-1]='\0';
if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
fprintf(stderr, _("arp: cant get HW-Address for `%s': %s.\n"), ifname, strerror(errno));
return (-1);
Description: Prevent buffer overflows from the cmdline by using strncpy.
Author: Martín Ferrari <tincho@debian.org>
Bug-Debian: http://bugs.debian.org/747006
--- a/lib/inet6_sr.c
+++ b/lib/inet6_sr.c
@@ -63,7 +63,8 @@
if (*args == NULL)
return (usage());
- strcpy(target, *args++);
+ strncpy(target, *args++, sizeof(target));
+ target[sizeof(target) - 1] = '\0';
if (!strcmp(target, "default")) {
prefix_len = 0;
memset(&sa6, 0, sizeof(sa6));
@@ -112,7 +113,8 @@
return (usage());
if (rt.rtmsg_flags & RTF_GATEWAY)
return (usage());
- strcpy(gateway, *args);
+ strncpy(gateway, *args, sizeof(gateway));
+ gateway[sizeof(gateway) - 1] = '\0';
if (inet6_aftype.input(1, gateway,
(struct sockaddr *) &sa6) < 0) {
inet6_aftype.herror(gateway);
@@ -152,7 +154,8 @@
}
if (devname) {
memset(&ifr, 0, sizeof(ifr));
- strcpy(ifr.ifr_name, devname);
+ strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name));
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
if (ioctl(skfd, SIOGIFINDEX, &ifr) < 0) {
perror("SIOGIFINDEX");
Subject: Fix improper format function usage.
--- a/rarp.c
+++ b/rarp.c
@@ -44,7 +44,7 @@
static char no_rarp_message[] = N_("This kernel does not support RARP.\n");
-static char version_string[] = RELEASE "\nrarp 1.03 (2001-04-04)\n";
+static char version_string[] = RELEASE "\nrarp 1.03 (2001-04-04)";
static struct hwtype *hardware = NULL;
@@ -226,7 +226,7 @@
case 'h':
usage();
case 'V':
- fprintf(stderr, version_string);
+ fputs(version_string, stderr);
exit(E_VERSION);
break;
case 'v':
--- a/slattach.c
+++ b/slattach.c
@@ -565,9 +565,9 @@
"[-o outfill] "
#endif
"[-c cmd] [-s speed] [-p protocol] tty | -\n"
- " slattach -V | --version\n";
+ " slattach -V | --version";
- fprintf(stderr, usage_msg);
+ fputs(usage_msg, stderr);
exit(1);
}
--- a/mii-tool.c
+++ b/mii-tool.c
@@ -271,7 +271,7 @@
if (opt_watch) {
if (opt_log) {
- syslog(LOG_INFO, buf);
+ syslog(LOG_INFO, "%s", buf);
} else {
char s[20];
time_t t = time(NULL);
This diff is collapsed.
This diff is collapsed.
Undocumented patches found in diff.gz.
--- a/netstat.c
+++ b/netstat.c
@@ -537,7 +537,7 @@
printf("%-10lu",inode);
}
if (flag_prg)
- printf(" %-" PROGNAME_WIDTHs "s",prg_cache_get(inode));
+ printf(" %-16s",prg_cache_get(inode));
if (flag_opt)
printf(" %s", timers);
putchar('\n');
@@ -1815,10 +1815,11 @@
}
printf(_("\nProto Recv-Q Send-Q Local Address Foreign Address State ")); /* xxx */
if (flag_exp > 1)
- printf(_(" User Inode "));
- print_progname_banner();
+ printf(_(" User Inode "));
+ if (flag_prg)
+ printf(_(" PID/Program name"));
if (flag_opt)
- printf(_(" Timer")); /* xxx */
+ printf(_(" Timer"));
printf("\n");
#else
if (flag_arg) {
Subject: Linux version now can be two-component.
--- a/lib/util.c
+++ b/lib/util.c
@@ -33,11 +33,11 @@
int kernel_version(void)
{
struct utsname uts;
- int major, minor, patch;
+ int major = 0, minor = 0, patch = 0;
if (uname(&uts) < 0)
return -1;
- if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
+ if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) < 2)
return -1;
return KRELEASE(major, minor, patch);
}
Bug#632660-netstat.c-long_udp6_addr.patch
Bug#541172-netstat.c-exit-codes.patch
netstat.c-local_changes.patch
translations.patch
lib_local_changes.patch
local-manpages.patch
Bug#345331-socket_overflow.patch
Bug#569509-iface_overflow.patch
Add_missing_headers.patch
proper-uts-check.patch
fix-fprintf.patch
Bug#747006-inet6_sr.c-buffer-overflows.patch
Bug#561161-statistics.c-long_numbers.patch
Bug#508110-inet6.c-initialize_fields.patch
Bug#443075-ifconfig.c-pointtopoint_spelling.patch
Bug#500913-man-en_US-route.8-EXAMPLES-Add-single-route-del.patch
Bug#532879-mii-tool.c-Scan_ethernet_devices_properly.patch
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment