View previous topic :: View next topic |
Author |
Message |
nascent
Joined: 07 Feb 2006 Posts: 26
|
Posted: Wed Feb 08, 2006 1:31 pm Post subject: Linux File Permissions |
|
|
Edit:: Changed the title to represent the actual subject.
I will first say that I first came across D about 2 years ago and found its goals quite interesting. At that time I hadn't really done any programming so I left. Now I have experiance in Java I decided to try a little D.
Now, I'm running Debian Linux (for about 6 months loyaly) and I have installed dmd. I wrote some code in a D file.
Code: | import std.stdio;
void main() {
writef("Hello world");
} |
ran $ dmd hello.d and it seems to compiled fine {hello.o & hello were created, no errors} I try and execute hello ($ ./hello) and it says "Permission denied" So I looked and found the file to be owned by root, but its permissions were 777. I tryed to change the owner via root and it told me "changing ownership of 'helo' : Operation not permitted"
I used method two of the install instructions at: wiki4d.
Have I done something wrong? Do I need to do more? _________________ I am myself and that is me.
Last edited by nascent on Wed Feb 08, 2006 7:49 pm; edited 1 time in total |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Wed Feb 08, 2006 2:00 pm Post subject: |
|
|
Somehow, I don't think the problem lies within DMD, as it seems to be working correctly. I would expect a core dump if the output binary wasn't composed correctly.
I'm totally spitballing here (not a linux geek), but google seems to think that this comes up a lot when the permissions of current directory won't allow the execution of stuff.
- Is the current partition marked 'noexec' by chance?
- Can you build and run C applications in the same directory, without trouble?
- Can you run any binary, stored in that directory, without trouble?
- Are you root? Do you get the same result if you use 'sudo' instead?
Another test, is to try and move that executable into a different directory and try from there. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Wed Feb 08, 2006 2:03 pm Post subject: |
|
|
What happens if you try to compile and run a C program from that directory?
If you can, then I'd say it's very weird.
If you can't, can you compile and run from another directory?
If you can, then maybe you should check that directory (first one) permissions. Maybe there's something wrong with it.
Other than that, I don't know what the problem could be. Good luck. |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Wed Feb 08, 2006 2:04 pm Post subject: |
|
|
pragma wrote: | Somehow, I don't think the problem lies within DMD, as it seems to be working correctly. I would expect a core dump if the output binary wasn't composed correctly.
I'm totally spitballing here (not a linux geek), but google seems to think that this comes up a lot when the permissions of current directory won't allow the execution of stuff.
- Is the current partition marked 'noexec' by chance?
- Can you build and run C applications in the same directory, without trouble?
- Can you run any binary, stored in that directory, without trouble?
- Are you root? Do you get the same result if you use 'sudo' instead?
Another test, is to try and move that executable into a different directory and try from there. |
Beat me by 3 minutes!!! |
|
Back to top |
|
|
nascent
Joined: 07 Feb 2006 Posts: 26
|
Posted: Wed Feb 08, 2006 3:14 pm Post subject: |
|
|
Thanks, I can run it from a different directory.
Where it was, was on a fat32 mounted partition that useing umask=000 in fstab that allows everyone to do everything, except run programs I guess.
So I guess I will come up with a new question that I can find the answer on google. How would I automatically mount this fat32 drive with a specific owner using fstab. If no one can answer I will post elsewhere as I want to be able to build D projects in the folder or would it be a fat32 drive not let linux run from it? _________________ I am myself and that is me. |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Wed Feb 08, 2006 5:08 pm Post subject: |
|
|
Carlos wrote: | Beat me by 3 minutes!!! |
::blows puff of smoke off of his trusty model-M::
Fastest keys this side of the mississipi.
::tips hat:: _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Wed Feb 08, 2006 5:15 pm Post subject: |
|
|
nascent wrote: | How would I automatically mount this fat32 drive with a specific owner using fstab. |
Well, I did dig up this gem from this page. It might help:
Code: |
/dev/hda7 /mnt/data vfat auto,users,umask=0007,gid=users 0 0
author: This is how I mount my Windows FAT32-partition that I need to have access to files used both with Linux and Windows.
|
There's also the good 'ol fstab man page. But if you're anything like me, you'll find that it reads like stereo instructions and is fantatsic if you want to get to bed early.
Edit: formatting. _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
|