Compiled a binary from the golang source, but it won't execute. I tried downloading the binary, which also didn't work. Permissions all seem to be right. Running the file from go for some reason works.
Output of ~/go$ go run src/github.com/exercism/cli/exercism/main.go1
:
NAME:
exercism - A command line tool to interact with http://exercism.io
USAGE:
main [global options] command [command options] [arguments...]
Output of ~/go/bin$ ./exercism
:
bash: ./exercism: Permission denied
Output of ~/go/bin$ ls -al
:
total 9932
drwxr-xr-x 2 joshua joshua 4096 Apr 28 12:17 .
drwxr-xr-x 5 joshua joshua 4096 Apr 28 12:17 ..
-rwxr-xr-x 1 joshua joshua 10159320 Apr 28 12:17 exercism
Output of ~/go/bin$ strace ./exercism
:
execve("./exercism", ["./exercism"], [/* 42 vars */]) = -1 EACCES (Permission denied)
write(2, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
exit_group(1) = ?
+++ exited with 1 +++
Best Answer
Check that
noexec
is not in effect on the mount point in question. Or choose a better place to launch your script from.noexec
exists specifically to prevent security issues that come from having world-writable places storing executable files; you might put a file there, but someone else might rewrite it before you execute it, and now you're not executing the code you thought you were.