From 232bb7bfceffabce04c0d95bbebe2ffd0478a264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Fri, 2 Oct 2020 15:21:31 +0200 Subject: [PATCH] Do not launch objdump in shell ... no point, just produces escaping issues. --- Sources/5GUIs/Utilities/OTool.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/5GUIs/Utilities/OTool.swift b/Sources/5GUIs/Utilities/OTool.swift index 256af11..e2eac77 100644 --- a/Sources/5GUIs/Utilities/OTool.swift +++ b/Sources/5GUIs/Utilities/OTool.swift @@ -116,9 +116,14 @@ private func run(objdump: String, against url: URL, private func run(objdump: String, against url: URL) throws -> [ String ] { // bash escaping let result = Process.launch(at: objdump, - with: [ "-macho", "--dylibs-used", "'\(url.path)'" ]) + with: [ "-macho", "--dylibs-used", url.path ], + using: .none /* no shell */) guard result.status == 0 else { - print("ERROR: objdump result:", result) + // status is 4 on signing errors (illegal instruction) + // status is 127 for bash errors + print("ERROR: objdump result:", result, + "\n path:", objdump, + "\n error:\n", result.stderr) throw OToolError.invocationFailed(status: result.status) }