LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   suid on directory - doesn't, sgid ok? (https://www.linuxquestions.org/questions/linux-security-4/suid-on-directory-doesnt-sgid-ok-404931/)

pingu 01-18-2006 09:38 AM

suid on directory - doesn't, sgid ok?
 
Strange problem this...
Fiddling with permissions, want to set user and group in a directory by sticky bits. Setting group works - but not user?

It should be like this (taking from samba.doc):
Code:

$ chmod 6775 /foodbar
$ ls -al /foodbar/..
You should see:
drwsrwsr-x  2 jack  engr    48 2003-02-04 09:55 foodbar
Now type:
$ su - jill
$ cd /foodbar
$ touch Afile
$ ls -al
You should see that the file Afile created by Jill will have ownership and permissions of Jack, as follows:
-rw-r--r--  1 jack  engr    0 2003-02-04 09:57 Afile

So I did the same:
ls -l /shares/
drwsrwsrwx 2 saras larare 4096 18 jan 16.16 saras
As user pingu:
# cd /shares/saras
# touch afile
# ls -l
-rw-rw-r-- 1 pingu larare 0 18 jan 16.20 Afile

Why the he... isn't user saras???

Oh, I forgot: I'm running Fedora Core4

tkedwards 01-18-2006 04:04 PM

I would've thought it should've worked too, but it doesnt:
info chmod:

Quote:

set the process's effective user ID to that of the file upon
execution (called the "setuid bit"). No effect on directories.


All times are GMT -5. The time now is 06:18 AM.