FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 10-19-2011, 04:50 PM
"shailesh "
 
Default bash: ./a.out: Permission denied

when i try to run compiled c program ("./a.out") get error

bash: ./a.out: Permission denied

Treat yourself at a restaurant, spa, resort and much more with Rediff Deal ho jaye!--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 05:01 PM
Brian Mury
 
Default bash: ./a.out: Permission denied

On Wed, Oct 19, 2011 at 09:50, shailesh <shailesh23jan@rediffmail.com> wrote:
>
> when i try to run compiled c program ("./a.out") get error
> bash: ./a.out: Permission denied

chmod u+x a.out
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 05:08 PM
Joe Zeff
 
Default bash: ./a.out: Permission denied

On 10/19/2011 09:50 AM, shailesh wrote:
> when i try to run compiled c program ("./a.out") get error
> bash: ./a.out: Permission denied

Files aren't automatically executable under Linux.

chmod u+x a.out
./a.out

will get you what you want.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 05:08 PM
Chris Tyler
 
Default bash: ./a.out: Permission denied

On Wed, 2011-10-19 at 10:01 -0700, Brian Mury wrote:
> On Wed, Oct 19, 2011 at 09:50, shailesh <shailesh23jan@rediffmail.com> wrote:
> >
> > when i try to run compiled c program ("./a.out") get error
> > bash: ./a.out: Permission denied
>
> chmod u+x a.out

If you *just* built this, then your umask may be wrong (too
restrictive). Try the default: umask 0002

-Chris

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 05:20 PM
"Bryn M. Reeves"
 
Default bash: ./a.out: Permission denied

On 10/19/2011 06:08 PM, Joe Zeff wrote:
> On 10/19/2011 09:50 AM, shailesh wrote:
>> when i try to run compiled c program ("./a.out") get error
>> bash: ./a.out: Permission denied
>
> Files aren't automatically executable under Linux.
>
> chmod u+x a.out
> ./a.out
>
> will get you what you want.

gcc (well, strictly speaking it's ld but called by gcc) normally gives
executable output files exec permissions when compiling regardless of umask:

$ umask 0002; echo -ne '#include <stdio.h>
int main(int argc, char
**argv)
{
printf("%s
", "Hello World!");
}' > x.c; strace -f gcc
x.c 2>&1 | grep chmod
[pid 11229] chmod("a.out", 0775) = 0

Getting EACCESS on a freshly compiled binary often implies that the file
system doesn't allow executable permissions - either it's mounted with
noexec, SELinux is preventing the exec or the file system does not
support executable permissions.

Are you using removable/network storage? What's does mount say?

Regards,
Bryn.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 05:20 PM
Andre Robatino
 
Default bash: ./a.out: Permission denied

Joe Zeff <joe <at> zeff.us> writes:

> On 10/19/2011 09:50 AM, shailesh wrote:
> > when i try to run compiled c program ("./a.out") get error
> > bash: ./a.out: Permission denied
>
> Files aren't automatically executable under Linux.
>
> chmod u+x a.out
> ./a.out
>
> will get you what you want.

But the question remains as to why it wasn't executable originally. On my F15
box, "gcc hello.c" results in a.out with perms 775 (using the default umask of
0002).




--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 10-19-2011, 08:29 PM
Roberto Ragusa
 
Default bash: ./a.out: Permission denied

On 10/19/2011 06:50 PM, shailesh wrote:
> when i try to run compiled c program ("./a.out") get error
> bash: ./a.out: Permission denied

Another explanation: you are working in a FAT filesystem,
which is discarding execution bits (mounted with noexec?).

--
Roberto Ragusa mail at robertoragusa.it
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 08:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org