You are not logged in.
Pages: 1
Hello. I'm learning C and created the following stupid test program:
#include <stdio.h>
main(){
printf("\nHello World!");
return(0);
}
Compiled: "gcc -o hello hello.c" then ran: "./hello". What do I get? "bash: ./hello: permission denied".
Yes, I do have permission to execute it:
[celso@arch c]$ ls -l hello*
-rwxr-xr-x 1 celso users 4401 2007-03-24 01:48 hello
-rw-r--r-- 1 celso users 71 2007-03-24 01:48 hello.c
-rw-r--r-- 1 celso users 75 2007-03-24 01:46 hello.c~
And no, gcc returned no errors.
I had no problem doing the same procedure on another distro (and executing the shameful C program), but it happened here in Arch. Have I missed something here, perhaps something very, very obvious?
Offline
Have you tried
chown celso:celso hello
?
Offline
What're the permissions on the pwd?
--edit-- eh, nevermind, I guess that's a dumb question. In my defense, it's late, and I'm tired. Not sure yet what's going on here...
Last edited by Cerebral (2007-03-24 05:22:32)
Offline
Have you tried
chown celso:celso hello
?
I don't think it's the case, as I'm under the users group:
[celso@arch c]$ groups
audio optical floppy storage users burning
- -
What're the permissions on the pwd?
I have full permissions there:
[celso@arch c]$ ls -l ../
total 4
drwxr-xr-x 2 celso users 4096 2007-03-24 01:59 c
- -
I went one step further and tried to run my little program as root:
[root@arch c]# ./hello
bash: ./hello: Permissão negada
"Permissão negada" means "permission denied". I even compiled it as root, and same error.
I've got no clue over what's happening. I love Arch, by the way.
Offline
maybe you have noexec in your fstab?
Offline
maybe you have noexec in your fstab?
I don't think this is the case. Here is the fstab line corresponding to the partition where my testing lies:
/dev/hdb6 /home/celso/stuff ext3 defaults,user 0 0
Offline
OK, solved. I thought puting "defaults" on the fstab entry would do, but it didn't. I straight added "exec" on it and now it works.
Thanks for the tips.
Offline
glad it works now, not sure why noexec was added by default, afaik exec is the default..
oh well
Offline
/dev/hdb6 /home/celso/stuff ext3 defaults,user 0 0
defaults -> exec
user -> noexec
Since user comes after defaults, noexec wins.
Offline
Pages: 1