From 7778014ee4243c7b6aa0e4ac762a2cc419c8f172 Mon Sep 17 00:00:00 2001 From: Ma Shimiao Date: Mon, 20 Jun 2016 16:56:01 +0800 Subject: [PATCH] validation: add args validation for process Signed-off-by: Ma Shimiao --- validate.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/validate.go b/validate.go index b2830e66f..719e8c14c 100644 --- a/validate.go +++ b/validate.go @@ -45,9 +45,9 @@ var ( ) var bundleValidateCommand = cli.Command{ - Name: "validate", - Usage: "validate a OCI bundle", - Flags: bundleValidateFlags, + Name: "validate", + Usage: "validate a OCI bundle", + Flags: bundleValidateFlags, Before: before, Action: func(context *cli.Context) error { inputPath := context.String("path") @@ -170,6 +170,10 @@ func checkProcess(process rspec.Process, rootfs string) { } } + if len(process.Args) < 1 { + logrus.Fatalf("args should not be empty") + } + for index := 0; index < len(process.Capabilities); index++ { capability := process.Capabilities[index] if !capValid(capability) {