File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545)
4646
4747var bundleValidateCommand = cli.Command {
48- Name : "validate" ,
49- Usage : "validate a OCI bundle" ,
50- Flags : bundleValidateFlags ,
48+ Name : "validate" ,
49+ Usage : "validate a OCI bundle" ,
50+ Flags : bundleValidateFlags ,
5151 Before : before ,
5252 Action : func (context * cli.Context ) error {
5353 inputPath := context .String ("path" )
@@ -170,6 +170,17 @@ func checkProcess(process rspec.Process, rootfs string) {
170170 }
171171 }
172172
173+ if len (process .Args ) < 1 {
174+ logrus .Fatalf ("args should not be empty" )
175+ }
176+ command := process .Args [0 ]
177+ if filepath .IsAbs (command ) {
178+ cmdPath := path .Join (rootfs , command )
179+ if _ , err := os .Stat (cmdPath ); err != nil {
180+ logrus .Fatalf ("Cannot find the command path %q" , cmdPath )
181+ }
182+ }
183+
173184 for index := 0 ; index < len (process .Capabilities ); index ++ {
174185 capability := process .Capabilities [index ]
175186 if ! capValid (capability ) {
You can’t perform that action at this time.
0 commit comments