ether-wake: apply Debian's hardening patch
This commit is contained in:
parent
9495cde082
commit
ac1079b24d
@ -1,6 +1,7 @@
|
|||||||
--- a/ether-wake.c 2013-09-03 18:15:13.000000000 +0200
|
diff -up net-tools-2.0/ether-wake.c.interfaces net-tools-2.0/ether-wake.c
|
||||||
+++ b/ether-wake.c 2013-09-03 17:39:02.000000000 +0200
|
--- net-tools-2.0/ether-wake.c.interfaces 2014-11-20 11:06:36.945067589 +0100
|
||||||
@@ -22,7 +22,7 @@
|
+++ net-tools-2.0/ether-wake.c 2014-11-20 11:07:22.984416283 +0100
|
||||||
|
@@ -22,7 +22,7 @@ static char usage_msg[] =
|
||||||
" Options:\n"
|
" Options:\n"
|
||||||
" -b Send wake-up packet to the broadcast address.\n"
|
" -b Send wake-up packet to the broadcast address.\n"
|
||||||
" -D Increase the debug level.\n"
|
" -D Increase the debug level.\n"
|
||||||
@ -9,7 +10,7 @@
|
|||||||
" -p <pw> Append the four or six byte password PW to the packet.\n"
|
" -p <pw> Append the four or six byte password PW to the packet.\n"
|
||||||
" A password is only required for a few adapter types.\n"
|
" A password is only required for a few adapter types.\n"
|
||||||
" The password may be specified in ethernet hex format\n"
|
" The password may be specified in ethernet hex format\n"
|
||||||
@@ -89,6 +89,9 @@
|
@@ -89,6 +89,9 @@ static char usage_msg[] =
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/ether.h>
|
#include <netinet/ether.h>
|
||||||
|
|
||||||
@ -19,7 +20,7 @@
|
|||||||
/* Grrr, no consistency between include versions.
|
/* Grrr, no consistency between include versions.
|
||||||
Enable this if setsockopt() isn't declared with your library. */
|
Enable this if setsockopt() isn't declared with your library. */
|
||||||
#if 0
|
#if 0
|
||||||
@@ -110,20 +113,29 @@
|
@@ -110,20 +113,29 @@ static int get_dest_addr(const char *arg
|
||||||
static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
|
static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
|
||||||
static int get_wol_pw(const char *optarg);
|
static int get_wol_pw(const char *optarg);
|
||||||
|
|
||||||
@ -57,7 +58,25 @@
|
|||||||
|
|
||||||
while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
|
while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@@ -177,13 +189,45 @@
|
@@ -131,7 +143,7 @@ int main(int argc, char *argv[])
|
||||||
|
case 'D': debug++; break;
|
||||||
|
case 'i': ifname = optarg; break;
|
||||||
|
case 'p': get_wol_pw(optarg); break;
|
||||||
|
- case 'u': printf(usage_msg); return 0;
|
||||||
|
+ case 'u': printf("%s",usage_msg); return 0;
|
||||||
|
case 'v': verbose++; break;
|
||||||
|
case 'V': do_version++; break;
|
||||||
|
case '?':
|
||||||
|
@@ -140,7 +152,7 @@ int main(int argc, char *argv[])
|
||||||
|
if (verbose || do_version)
|
||||||
|
printf("%s\n", version_msg);
|
||||||
|
if (errflag) {
|
||||||
|
- fprintf(stderr, brief_usage_msg);
|
||||||
|
+ fprintf(stderr,"%s", brief_usage_msg);
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -177,13 +189,45 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
pktsize = get_fill(outpack, &eaddr);
|
pktsize = get_fill(outpack, &eaddr);
|
||||||
|
|
||||||
@ -97,7 +116,7 @@
|
|||||||
if (! opt_no_src_addr) {
|
if (! opt_no_src_addr) {
|
||||||
struct ifreq if_hwaddr;
|
struct ifreq if_hwaddr;
|
||||||
- unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
|
- unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
|
||||||
+ char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
|
+ const char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
|
||||||
|
|
||||||
- strcpy(if_hwaddr.ifr_name, ifname);
|
- strcpy(if_hwaddr.ifr_name, ifname);
|
||||||
+ strncpy(if_hwaddr.ifr_name, ifname, IFNAMSIZ);
|
+ strncpy(if_hwaddr.ifr_name, ifname, IFNAMSIZ);
|
||||||
@ -105,7 +124,7 @@
|
|||||||
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
|
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
|
||||||
fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
|
fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@@ -220,7 +264,8 @@
|
@@ -220,7 +264,8 @@ int main(int argc, char *argv[])
|
||||||
#if defined(PF_PACKET)
|
#if defined(PF_PACKET)
|
||||||
{
|
{
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
@ -115,9 +134,10 @@
|
|||||||
if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
|
if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
|
||||||
fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
|
fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
--- a/Makefile 2013-09-03 13:15:22.531951613 +0100
|
diff -up net-tools-2.0/Makefile.interfaces net-tools-2.0/Makefile
|
||||||
+++ b/Makefile 2013-09-03 13:24:29.659823455 +0100
|
--- net-tools-2.0/Makefile.interfaces 2014-10-07 03:26:10.000000000 +0200
|
||||||
@@ -188,6 +188,8 @@
|
+++ net-tools-2.0/Makefile 2014-11-20 11:06:36.955067448 +0100
|
||||||
|
@@ -193,6 +193,8 @@ ipmaddr: $(NET_LIB) ipmaddr.o
|
||||||
mii-tool: $(NET_LIB) mii-tool.o
|
mii-tool: $(NET_LIB) mii-tool.o
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(RESLIB)
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(RESLIB)
|
||||||
|
|
||||||
@ -126,9 +146,10 @@
|
|||||||
installbin:
|
installbin:
|
||||||
@echo
|
@echo
|
||||||
@echo "######################################################"
|
@echo "######################################################"
|
||||||
--- a/man/en_US/ether-wake.8 2013-09-03 13:15:22.576952098 +0100
|
diff -up net-tools-2.0/man/en_US/ether-wake.8.interfaces net-tools-2.0/man/en_US/ether-wake.8
|
||||||
+++ b/man/en_US/ether-wake.8 2013-09-03 13:14:55.270657575 +0100
|
--- net-tools-2.0/man/en_US/ether-wake.8.interfaces 2014-11-20 11:06:36.947067561 +0100
|
||||||
@@ -49,7 +49,7 @@
|
+++ net-tools-2.0/man/en_US/ether-wake.8 2014-11-20 11:06:36.955067448 +0100
|
||||||
|
@@ -49,7 +49,7 @@ Send the wake-up packet to the broadcast
|
||||||
Increase the Debug Level.
|
Increase the Debug Level.
|
||||||
.TP
|
.TP
|
||||||
.B \-i ifname
|
.B \-i ifname
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Summary: Basic networking tools
|
Summary: Basic networking tools
|
||||||
Name: net-tools
|
Name: net-tools
|
||||||
Version: 2.0
|
Version: 2.0
|
||||||
Release: 0.29.%{checkout}%{?dist}
|
Release: 0.30.%{checkout}%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
URL: http://sourceforge.net/projects/net-tools/
|
URL: http://sourceforge.net/projects/net-tools/
|
||||||
@ -167,6 +167,9 @@ install -D -p -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/arp-ethers.service
|
|||||||
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
|
%attr(0644,root,root) %{_unitdir}/arp-ethers.service
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Nov 20 2014 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.30.20141007git
|
||||||
|
- ether-wake: apply Debian's hardening patch
|
||||||
|
|
||||||
* Tue Oct 07 2014 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.29.20141007git
|
* Tue Oct 07 2014 Jiri Popelka <jpopelka@redhat.com> - 2.0-0.29.20141007git
|
||||||
- latest upstream snapshot (#1149405)
|
- latest upstream snapshot (#1149405)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user