Click to See Complete Forum and Search --> : File Permissions / Ownership


macian
09-27-2002, 11:18 AM
What i am attempting to do is set the permissions on a folder so that any files created in that folder take on the same ownership as said folder.

Thanks in advance

macian
09-27-2002, 11:57 AM
chmod g+s works for the group, but will anything work for the owner. Also so that the file in the folder takes on the same permissions as that folder.

The Elf
09-27-2002, 01:48 PM
iirc, using the suid bit on a directory will cause everything created within said directory to be owned by the user that owns the directory. Try chmod u+s (I think that's right, I always use the numbers anyway, in which case it would be 4###

macian
09-27-2002, 01:51 PM
chmod u+s does not work for user. 4*** is for something else at this time i can not remember. Tried that already... thanks for the help though..

nunder
09-27-2002, 02:15 PM
Have you looked through the NHF's?

http://www.linuxnewbie.org/nhf/Filesystems/File_Permissions.html

macian
09-27-2002, 02:28 PM
thanks... but read my post's...

nunder
09-27-2002, 02:36 PM
I'm sorry, I wasn't trying to be a smart a$$, but would the set group id not work? I may be way off here (in which case I get to learn something).

macian
09-27-2002, 02:44 PM
i apologize.... far too often i get answer that say RTFM for things i've read time and time again....


i have a php script that allows for uploading pics via a web intervace. when the pics are upload they have this


-rwxr-xr-x apache apache

Yeah... chmod g+s makes the group ownership for the folder recursive.


drwxrwsr-x me somegroup is the folder, which is cool... When apache makes a file in that directory it makes the file

-rwxr-s-r-x apache somegroup which is also somewhat cool because the group is correct, but i still can't really do **** with the file because the group permissions are not writable.

what i need is apache to make the files either

-rwxr-sr-x me somegroup OR
-rwxrwsr-x apache somegroup

see what im sayin?