1833882 Members
2025 Online
110063 Solutions
New Discussion

setuid file question

 
SOLVED
Go to solution
dictum9
Super Advisor

setuid file question


If the file has the ownership of:

-rwSr-----

As far as I understand, that "S" means it's setuid, but what is the point of having setuid if nobody else can execute the file?

6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: setuid file question

Actually 'S' as opposed to 's' indicates that no execute bit is set so that this is not, if fact, an executable but a data file. ie. the mode of the file is 4640 rather than 4740. In this case because this is a data file rather than an executable, the setuid bit may be serving as a flag for the application as it has no significance in any other context.
If it ain't broke, I can fix that.
Rodney Hills
Honored Contributor

Re: setuid file question

FYI- And if this is a directory it has a special meaning. If any user could create files under the directory the "S" specifies that only the owners of a file can delete them.

Rod Hills
There be dragons...
A. Clay Stephenson
Acclaimed Contributor

Re: setuid file question

Except that it's not a directory and a directory would be especially useless without the search bit enabled for the owner.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: setuid file question

Oh, and even if it were a directory, it's the "sticky" bit (octal 1000) that applies as opposed to the setuid bit (octal 4000). Sorry, Rodney.
If it ain't broke, I can fix that.
dictum9
Super Advisor

Re: setuid file question

> the setuid bit may be serving as a flag for the application


What do you mean by that?
James R. Ferguson
Acclaimed Contributor

Re: setuid file question

Hi:

The suggetion that "...the setuid bit may be serving as a flag for the application..." derives from a discussion last month wherein it was noted that the SUID bit could serve as a marker for a data file instead of its normal use to confer access rights for an executable. Follow the discussion here:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1015500

Regards!

...JRF...