Skip to content

Commit

Permalink
Charmrun: Check if runscript argument is executable (#3580)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuch committed Mar 18, 2022
1 parent a167573 commit 8772f9a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/util/charmrun-src/charmrun.C
Original file line number Diff line number Diff line change
Expand Up @@ -4142,6 +4142,15 @@ int main(int argc, const char **argv, char **envp)
host_table.resize(arg_requested_numhosts);
}

#if !defined(_WIN32)
if (arg_runscript && access(arg_runscript, X_OK))
{
fprintf(stderr, "Charmrun> Error: runscript \"%s\" is not executable: %s\n",
arg_runscript, strerror(errno));
exit(1);
}
#endif

if (arg_verbose)
{
char ips[200];
Expand Down

0 comments on commit 8772f9a

Please sign in to comment.