[minijail] check permissions on target

Check that the target a) exists and b) is executable before trying to run it. If
it isn't, give an error message. This is more user friendly than the previous
behavior of 'exit with a failing error code'.

BUG=chromium:208335
TEST=adhoc
run 'minijail0 /nonexistent', note error
run 'minijail0 /usr/bin/id', note lack of error

Change-Id: Icf9641a35e7b97bda747d9e73eae2d311bb77be8
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45877
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
1 file changed