Skip to content

Commit 6acdbf9

Browse files
committed
Also remove None handling in dangerous_nsenter
1 parent 1ff1890 commit 6acdbf9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

checkbox-ng/plainbox/impl/execution.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -776,17 +776,13 @@ def dangerous_nsenter(path):
776776
"""
777777
Creates a dangerous nsenter copy at path with cap_sys_admin,cap_sys_chroot
778778
"""
779-
if path is None:
780-
# this command doens't need dangerous nsenter
781-
yield path
782-
return
783779
try:
784780
# here recover setcap and nsenter binaries path outside the sandbox
785781
runtime_path = get_checkbox_runtime_path()
786782
runtime_nsenter = runtime_path / "usr" / "bin" / "nsenter"
787783
# Note: this path only works on core<24, on core24+ this is in
788-
# /usr/sbin but this code should only work on core16, so this is
789-
# fine
784+
# /usr/sbin but this code should only be used on core16, so this
785+
# is fine
790786
runtime_setcap = runtime_path / "sbin" / "setcap"
791787
setcap_path = str(runtime_setcap)
792788
nsenter_path = str(runtime_nsenter)

0 commit comments

Comments
 (0)