summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/osh/osh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/osh/osh.c b/usr.bin/osh/osh.c
index 4064c12..93ac876 100644
--- a/usr.bin/osh/osh.c
+++ b/usr.bin/osh/osh.c
@@ -222,6 +222,12 @@ cmd_run(const char *input, int argc, char *argv[])
int error;
snprintf(bin_path, sizeof(bin_path), "/usr/bin/%s", input);
+
+ /* See if we can access it */
+ if (access(bin_path, F_OK) != 0) {
+ return -1;
+ }
+
if ((error = spawn(bin_path, SPAWN_WAIT)) < 0) {
return error;
}