Skip to content

Commit 1fdc5c5

Browse files
authored
Merge pull request #501 from coreemu/release-7.0.1
Release 7.0.1
2 parents eb70386 + afe434f commit 1fdc5c5

23 files changed

+80
-65
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2020-07-28 CORE 7.0.1
2+
3+
* Bugfixes
4+
* \#500 - fixed issue running node commands with shell=True
5+
* fixed issue for poetry based install not properly vetting requirements for dataclasses dependency
6+
17
## 2020-07-23 CORE 7.0.0
28

39
* Breaking Changes

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
# this defines the CORE version number, must be static for AC_INIT
5-
AC_INIT(core, 7.0.0)
5+
AC_INIT(core, 7.0.1)
66

77
# autoconf and automake initialization
88
AC_CONFIG_SRCDIR([netns/version.h.in])

daemon/core/configservices/frrservices/services.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class FRRZebra(ConfigService):
6565
]
6666
executables: List[str] = ["zebra"]
6767
dependencies: List[str] = []
68-
startup: List[str] = ["sh frrboot.sh zebra"]
68+
startup: List[str] = ["bash frrboot.sh zebra"]
6969
validate: List[str] = ["pidof zebra"]
7070
shutdown: List[str] = ["killall zebra"]
7171
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING

daemon/core/configservices/nrlservices/services.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class MgenSinkService(ConfigService):
1414
files: List[str] = ["mgensink.sh", "sink.mgen"]
1515
executables: List[str] = ["mgen"]
1616
dependencies: List[str] = []
17-
startup: List[str] = ["sh mgensink.sh"]
17+
startup: List[str] = ["bash mgensink.sh"]
1818
validate: List[str] = ["pidof mgen"]
1919
shutdown: List[str] = ["killall mgen"]
2020
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -36,7 +36,7 @@ class NrlNhdp(ConfigService):
3636
files: List[str] = ["nrlnhdp.sh"]
3737
executables: List[str] = ["nrlnhdp"]
3838
dependencies: List[str] = []
39-
startup: List[str] = ["sh nrlnhdp.sh"]
39+
startup: List[str] = ["bash nrlnhdp.sh"]
4040
validate: List[str] = ["pidof nrlnhdp"]
4141
shutdown: List[str] = ["killall nrlnhdp"]
4242
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -58,7 +58,7 @@ class NrlSmf(ConfigService):
5858
files: List[str] = ["startsmf.sh"]
5959
executables: List[str] = ["nrlsmf", "killall"]
6060
dependencies: List[str] = []
61-
startup: List[str] = ["sh startsmf.sh"]
61+
startup: List[str] = ["bash startsmf.sh"]
6262
validate: List[str] = ["pidof nrlsmf"]
6363
shutdown: List[str] = ["killall nrlsmf"]
6464
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -93,7 +93,7 @@ class NrlOlsr(ConfigService):
9393
files: List[str] = ["nrlolsrd.sh"]
9494
executables: List[str] = ["nrlolsrd"]
9595
dependencies: List[str] = []
96-
startup: List[str] = ["sh nrlolsrd.sh"]
96+
startup: List[str] = ["bash nrlolsrd.sh"]
9797
validate: List[str] = ["pidof nrlolsrd"]
9898
shutdown: List[str] = ["killall nrlolsrd"]
9999
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -117,7 +117,7 @@ class NrlOlsrv2(ConfigService):
117117
files: List[str] = ["nrlolsrv2.sh"]
118118
executables: List[str] = ["nrlolsrv2"]
119119
dependencies: List[str] = []
120-
startup: List[str] = ["sh nrlolsrv2.sh"]
120+
startup: List[str] = ["bash nrlolsrv2.sh"]
121121
validate: List[str] = ["pidof nrlolsrv2"]
122122
shutdown: List[str] = ["killall nrlolsrv2"]
123123
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -139,7 +139,7 @@ class OlsrOrg(ConfigService):
139139
files: List[str] = ["olsrd.sh", "/etc/olsrd/olsrd.conf"]
140140
executables: List[str] = ["olsrd"]
141141
dependencies: List[str] = []
142-
startup: List[str] = ["sh olsrd.sh"]
142+
startup: List[str] = ["bash olsrd.sh"]
143143
validate: List[str] = ["pidof olsrd"]
144144
shutdown: List[str] = ["killall olsrd"]
145145
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -161,7 +161,7 @@ class MgenActor(ConfigService):
161161
files: List[str] = ["start_mgen_actor.sh"]
162162
executables: List[str] = ["mgen"]
163163
dependencies: List[str] = []
164-
startup: List[str] = ["sh start_mgen_actor.sh"]
164+
startup: List[str] = ["bash start_mgen_actor.sh"]
165165
validate: List[str] = ["pidof mgen"]
166166
shutdown: List[str] = ["killall mgen"]
167167
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -176,7 +176,7 @@ class Arouted(ConfigService):
176176
files: List[str] = ["startarouted.sh"]
177177
executables: List[str] = ["arouted"]
178178
dependencies: List[str] = []
179-
startup: List[str] = ["sh startarouted.sh"]
179+
startup: List[str] = ["bash startarouted.sh"]
180180
validate: List[str] = ["pidof arouted"]
181181
shutdown: List[str] = ["pkill arouted"]
182182
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING

daemon/core/configservices/quaggaservices/services.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Zebra(ConfigService):
6565
]
6666
executables: List[str] = ["zebra"]
6767
dependencies: List[str] = []
68-
startup: List[str] = ["sh quaggaboot.sh zebra"]
68+
startup: List[str] = ["bash quaggaboot.sh zebra"]
6969
validate: List[str] = ["pidof zebra"]
7070
shutdown: List[str] = ["killall zebra"]
7171
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING

daemon/core/configservices/securityservices/services.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class VpnClient(ConfigService):
1414
files: List[str] = ["vpnclient.sh"]
1515
executables: List[str] = ["openvpn", "ip", "killall"]
1616
dependencies: List[str] = []
17-
startup: List[str] = ["sh vpnclient.sh"]
17+
startup: List[str] = ["bash vpnclient.sh"]
1818
validate: List[str] = ["pidof openvpn"]
1919
shutdown: List[str] = ["killall openvpn"]
2020
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -48,7 +48,7 @@ class VpnServer(ConfigService):
4848
files: List[str] = ["vpnserver.sh"]
4949
executables: List[str] = ["openvpn", "ip", "killall"]
5050
dependencies: List[str] = []
51-
startup: List[str] = ["sh vpnserver.sh"]
51+
startup: List[str] = ["bash vpnserver.sh"]
5252
validate: List[str] = ["pidof openvpn"]
5353
shutdown: List[str] = ["killall openvpn"]
5454
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -91,7 +91,7 @@ class IPsec(ConfigService):
9191
files: List[str] = ["ipsec.sh"]
9292
executables: List[str] = ["racoon", "ip", "setkey", "killall"]
9393
dependencies: List[str] = []
94-
startup: List[str] = ["sh ipsec.sh"]
94+
startup: List[str] = ["bash ipsec.sh"]
9595
validate: List[str] = ["pidof racoon"]
9696
shutdown: List[str] = ["killall racoon"]
9797
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -106,7 +106,7 @@ class Firewall(ConfigService):
106106
files: List[str] = ["firewall.sh"]
107107
executables: List[str] = ["iptables"]
108108
dependencies: List[str] = []
109-
startup: List[str] = ["sh firewall.sh"]
109+
startup: List[str] = ["bash firewall.sh"]
110110
validate: List[str] = []
111111
shutdown: List[str] = []
112112
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -121,7 +121,7 @@ class Nat(ConfigService):
121121
files: List[str] = ["nat.sh"]
122122
executables: List[str] = ["iptables"]
123123
dependencies: List[str] = []
124-
startup: List[str] = ["sh nat.sh"]
124+
startup: List[str] = ["bash nat.sh"]
125125
validate: List[str] = []
126126
shutdown: List[str] = []
127127
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING

daemon/core/configservices/utilservices/services.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DefaultRouteService(ConfigService):
1616
files: List[str] = ["defaultroute.sh"]
1717
executables: List[str] = ["ip"]
1818
dependencies: List[str] = []
19-
startup: List[str] = ["sh defaultroute.sh"]
19+
startup: List[str] = ["bash defaultroute.sh"]
2020
validate: List[str] = []
2121
shutdown: List[str] = []
2222
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -44,7 +44,7 @@ class DefaultMulticastRouteService(ConfigService):
4444
files: List[str] = ["defaultmroute.sh"]
4545
executables: List[str] = []
4646
dependencies: List[str] = []
47-
startup: List[str] = ["sh defaultmroute.sh"]
47+
startup: List[str] = ["bash defaultmroute.sh"]
4848
validate: List[str] = []
4949
shutdown: List[str] = []
5050
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -66,7 +66,7 @@ class StaticRouteService(ConfigService):
6666
files: List[str] = ["staticroute.sh"]
6767
executables: List[str] = []
6868
dependencies: List[str] = []
69-
startup: List[str] = ["sh staticroute.sh"]
69+
startup: List[str] = ["bash staticroute.sh"]
7070
validate: List[str] = []
7171
shutdown: List[str] = []
7272
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -94,7 +94,7 @@ class IpForwardService(ConfigService):
9494
files: List[str] = ["ipforward.sh"]
9595
executables: List[str] = ["sysctl"]
9696
dependencies: List[str] = []
97-
startup: List[str] = ["sh ipforward.sh"]
97+
startup: List[str] = ["bash ipforward.sh"]
9898
validate: List[str] = []
9999
shutdown: List[str] = []
100100
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -116,7 +116,7 @@ class SshService(ConfigService):
116116
files: List[str] = ["startsshd.sh", "/etc/ssh/sshd_config"]
117117
executables: List[str] = ["sshd"]
118118
dependencies: List[str] = []
119-
startup: List[str] = ["sh startsshd.sh"]
119+
startup: List[str] = ["bash startsshd.sh"]
120120
validate: List[str] = []
121121
shutdown: List[str] = ["killall sshd"]
122122
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -164,7 +164,7 @@ class DhcpClientService(ConfigService):
164164
files: List[str] = ["startdhcpclient.sh"]
165165
executables: List[str] = ["dhclient"]
166166
dependencies: List[str] = []
167-
startup: List[str] = ["sh startdhcpclient.sh"]
167+
startup: List[str] = ["bash startdhcpclient.sh"]
168168
validate: List[str] = ["pidof dhclient"]
169169
shutdown: List[str] = ["killall dhclient"]
170170
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
@@ -200,9 +200,9 @@ class PcapService(ConfigService):
200200
files: List[str] = ["pcap.sh"]
201201
executables: List[str] = ["tcpdump"]
202202
dependencies: List[str] = []
203-
startup: List[str] = ["sh pcap.sh start"]
203+
startup: List[str] = ["bash pcap.sh start"]
204204
validate: List[str] = ["pidof tcpdump"]
205-
shutdown: List[str] = ["sh pcap.sh stop"]
205+
shutdown: List[str] = ["bash pcap.sh stop"]
206206
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
207207
default_configs: List[Configuration] = []
208208
modes: Dict[str, Dict[str, str]] = {}
@@ -249,7 +249,7 @@ class AtdService(ConfigService):
249249
files: List[str] = ["startatd.sh"]
250250
executables: List[str] = ["atd"]
251251
dependencies: List[str] = []
252-
startup: List[str] = ["sh startatd.sh"]
252+
startup: List[str] = ["bash startatd.sh"]
253253
validate: List[str] = ["pidof atd"]
254254
shutdown: List[str] = ["pkill atd"]
255255
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING

daemon/core/executables.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import List
22

3+
BASH: str = "bash"
34
VNODED: str = "vnoded"
45
VCMD: str = "vcmd"
56
SYSCTL: str = "sysctl"
@@ -11,7 +12,16 @@
1112
UMOUNT: str = "umount"
1213
OVS_VSCTL: str = "ovs-vsctl"
1314

14-
COMMON_REQUIREMENTS: List[str] = [SYSCTL, IP, ETHTOOL, TC, EBTABLES, MOUNT, UMOUNT]
15+
COMMON_REQUIREMENTS: List[str] = [
16+
BASH,
17+
EBTABLES,
18+
ETHTOOL,
19+
IP,
20+
MOUNT,
21+
SYSCTL,
22+
TC,
23+
UMOUNT,
24+
]
1525
VCMD_REQUIREMENTS: List[str] = [VNODED, VCMD]
1626
OVS_REQUIREMENTS: List[str] = [OVS_VSCTL]
1727

daemon/core/location/mobility.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
RegisterTlvs,
2323
)
2424
from core.errors import CoreError
25+
from core.executables import BASH
2526
from core.nodes.base import CoreNode
2627
from core.nodes.interface import CoreInterface
2728
from core.nodes.network import WlanNode
@@ -1167,7 +1168,7 @@ def statescript(self, typestr: str) -> None:
11671168
if filename is None or filename == "":
11681169
return
11691170
filename = self.findfile(filename)
1170-
args = f"/bin/sh {filename} {typestr}"
1171+
args = f"{BASH} {filename} {typestr}"
11711172
utils.cmd(
11721173
args, cwd=self.session.session_dir, env=self.session.get_environment()
11731174
)

daemon/core/nodes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def cmd(self, args: str, wait: bool = True, shell: bool = False) -> str:
599599
if self.server is None:
600600
return self.client.check_cmd(args, wait=wait, shell=shell)
601601
else:
602-
args = self.client.create_cmd(args)
602+
args = self.client.create_cmd(args, shell)
603603
return self.server.remote_cmd(args, wait=wait)
604604

605605
def termcmdstring(self, sh: str = "/bin/sh") -> str:

daemon/core/nodes/client.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
from core import utils
8-
from core.executables import VCMD
8+
from core.executables import BASH, VCMD
99

1010

1111
class VnodeClient:
@@ -49,7 +49,9 @@ def close(self) -> None:
4949
"""
5050
pass
5151

52-
def create_cmd(self, args: str) -> str:
52+
def create_cmd(self, args: str, shell: bool = False) -> str:
53+
if shell:
54+
args = f'{BASH} -c "{args}"'
5355
return f"{VCMD} -c {self.ctrlchnlname} -- {args}"
5456

5557
def check_cmd(self, args: str, wait: bool = True, shell: bool = False) -> str:
@@ -63,5 +65,5 @@ def check_cmd(self, args: str, wait: bool = True, shell: bool = False) -> str:
6365
:raises core.CoreCommandError: when there is a non-zero exit status
6466
"""
6567
self._verify_connection()
66-
args = self.create_cmd(args)
68+
args = self.create_cmd(args, shell)
6769
return utils.cmd(args, wait=wait, shell=shell)

daemon/core/nodes/interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ def shutdown(self) -> None:
383383
try:
384384
self.node.node_net_client.device_flush(self.name)
385385
except CoreCommandError:
386-
logging.exception("error shutting down interface")
386+
pass
387387
if self.localname:
388388
try:
389389
self.net_client.delete_device(self.localname)
390390
except CoreCommandError:
391-
logging.info("link already removed: %s", self.localname)
391+
pass
392392
self.up = False
393393

394394

daemon/core/nodes/netclient.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@ def device_flush(self, device: str) -> None:
121121
:param device: device to flush
122122
:return: nothing
123123
"""
124-
self.run(
125-
f"[ -e /sys/class/net/{device} ] && "
126-
f"{IP} address flush dev {device} || true",
127-
shell=True,
128-
)
124+
self.run(f"{IP} address flush dev {device}")
129125

130126
def device_mac(self, device: str, mac: str) -> None:
131127
"""

daemon/core/services/emaneservices.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class EmaneTransportService(CoreService):
1313
dependencies: Tuple[str, ...] = ()
1414
dirs: Tuple[str, ...] = ()
1515
configs: Tuple[str, ...] = ("emanetransport.sh",)
16-
startup: Tuple[str, ...] = (f"sh {configs[0]}",)
16+
startup: Tuple[str, ...] = (f"bash {configs[0]}",)
1717
validate: Tuple[str, ...] = (f"pidof {executables[0]}",)
1818
validation_timer: float = 0.5
1919
shutdown: Tuple[str, ...] = (f"killall {executables[0]}",)

daemon/core/services/frr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FRRZebra(CoreService):
2626
"/usr/local/etc/frr/vtysh.conf",
2727
"/usr/local/etc/frr/daemons",
2828
)
29-
startup: Tuple[str, ...] = ("sh frrboot.sh zebra",)
29+
startup: Tuple[str, ...] = ("bash frrboot.sh zebra",)
3030
shutdown: Tuple[str, ...] = ("killall zebra",)
3131
validate: Tuple[str, ...] = ("pidof zebra",)
3232

daemon/core/services/nrl.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class NrlSmf(NrlService):
9797

9898
name: str = "SMF"
9999
executables: Tuple[str, ...] = ("nrlsmf",)
100-
startup: Tuple[str, ...] = ("sh startsmf.sh",)
100+
startup: Tuple[str, ...] = ("bash startsmf.sh",)
101101
shutdown: Tuple[str, ...] = ("killall nrlsmf",)
102102
validate: Tuple[str, ...] = ("pidof nrlsmf",)
103103
configs: Tuple[str, ...] = ("startsmf.sh",)
@@ -566,7 +566,7 @@ class MgenActor(NrlService):
566566
group: str = "ProtoSvc"
567567
executables: Tuple[str, ...] = ("mgen",)
568568
configs: Tuple[str, ...] = ("start_mgen_actor.sh",)
569-
startup: Tuple[str, ...] = ("sh start_mgen_actor.sh",)
569+
startup: Tuple[str, ...] = ("bash start_mgen_actor.sh",)
570570
validate: Tuple[str, ...] = ("pidof mgen",)
571571
shutdown: Tuple[str, ...] = ("killall mgen",)
572572

@@ -596,7 +596,7 @@ class Arouted(NrlService):
596596
name: str = "arouted"
597597
executables: Tuple[str, ...] = ("arouted",)
598598
configs: Tuple[str, ...] = ("startarouted.sh",)
599-
startup: Tuple[str, ...] = ("sh startarouted.sh",)
599+
startup: Tuple[str, ...] = ("bash startarouted.sh",)
600600
shutdown: Tuple[str, ...] = ("pkill arouted",)
601601
validate: Tuple[str, ...] = ("pidof arouted",)
602602

daemon/core/services/quagga.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Zebra(CoreService):
2525
"quaggaboot.sh",
2626
"/usr/local/etc/quagga/vtysh.conf",
2727
)
28-
startup: Tuple[str, ...] = ("sh quaggaboot.sh zebra",)
28+
startup: Tuple[str, ...] = ("bash quaggaboot.sh zebra",)
2929
shutdown: Tuple[str, ...] = ("killall zebra",)
3030
validate: Tuple[str, ...] = ("pidof zebra",)
3131

0 commit comments

Comments
 (0)