File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ extension App {
7373 }
7474
7575 static func exec( process: ContainerizationOCI . Process , currentEnv: [ String ] ? = nil ) throws {
76+ guard !process. args. isEmpty else {
77+ throw App . Errno ( stage: " exec " , info: " process args cannot be empty " )
78+ }
79+
7680 // lookup executable
7781 let path = Path . findPath ( currentEnv) ?? Path . getCurrentPath ( )
7882 guard let resolvedExecutable = Path . lookPath ( process. args [ 0 ] , path: path) else {
@@ -88,11 +92,11 @@ extension App {
8892
8993 // switch cwd
9094 guard chdir ( cwd) == 0 else {
91- throw App . Errno ( stage: " chdir(cwd) " , info: " Failed to change directory to '\( cwd) ' " )
95+ throw App . Errno ( stage: " chdir(cwd) " , info: " failed to change directory to '\( cwd) ' " )
9296 }
9397
9498 guard execvpe ( executable, argv, env) != - 1 else {
95- throw App . Errno ( stage: " execvpe( \( String ( describing: executable) ) ) " , info: " Failed to exec [\( process. args. joined ( separator: " " ) ) ] " )
99+ throw App . Errno ( stage: " execvpe( \( String ( describing: executable) ) ) " , info: " failed to exec [\( process. args. joined ( separator: " " ) ) ] " )
96100 }
97101 fatalError ( " execvpe failed " )
98102 }
You can’t perform that action at this time.
0 commit comments