Results 1 to 8 of 8
Who is allowed to execute chmod on a file? Only the owner?
If I don't have x privilege for a file then why am I allowed to execute it by ...
- 11-05-2011 #1Just Joined!
- Join Date
- Oct 2011
- Location
- STL, USA
- Posts
- 8
Execution Privileges?
Who is allowed to execute chmod on a file? Only the owner?
If I don't have x privilege for a file then why am I allowed to execute it by shelling out?
What files am I allowed to execute by shelling out?
Thanks.
- 11-06-2011 #2
Hello davejjj,
May I please ask what you mean by "shelling out"?
Anyways, the owner or anybody with privileges as root (su -, or sudo) can chmod. If I am not mistaken.nujinini
Linux User #489667
- 11-06-2011 #3What do you mean by shelling out? Even google couldn't find out relevant info.
Originally Posted by davejjj
Have you checked manual of chmod command?It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 11-06-2011 #4
Could shelling out be
although even in that case I'm not sure of the answer to the original question.Code:bash myscript
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 11-06-2011 #5
You may be right, elija.
The only other thought I had would be specifying the path.
Code:/entire/path/to/command
Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 11-06-2011 #6
With regards to "shelling out":
Executing a script works differently from executing a compiled program. In particular, executing a script is simply giving input to another program. When you execute a script like:
The OS, behind the scenes, converts it to executing the program /usr/bin/perl, with the input of the script.Code:#!/usr/bin/perl LINES
So, the answer to "why can you execute it by shelling out?" (assuming that shelling out means executing the script as "bash SCRIPT" instead of "./SCRIPT") is that as long as a user can read the file, he could input it into the interpreter program directly.
Note that if you had a script that was both unexecutable and unreadable, it could not be executed at all.
This does not apply to compiled programs, which are executed directly by the system. If a compiled program does not have executable privileges, it cannot be executed. However, if it is readable, it could be copied, the copy made executable, and then executed.DISTRO=Arch
Registered Linux User #388732
- 11-06-2011 #7
Makes sense...
I think we're all just stuck here wondering, though, until the OP pops back in to explain what he means.Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 11-09-2011 #8Just Joined!
- Join Date
- Oct 2011
- Location
- STL, USA
- Posts
- 8
Oh, I'm sorry, I was led to believe that was the standard terminology. What I mean is that if you have written a script and you have not set the x bit for that file, you can still type...
sh ./myscript
...and execute the script. This led me to wonder whether this only worked because of the specifics of the situation. Thanks. Sorry for the delay in getting back here.


Reply With Quote
