LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Setting group on file creation/edit (https://www.linuxquestions.org/questions/linux-security-4/setting-group-on-file-creation-edit-334638/)

deiussum 06-17-2005 01:17 PM

Setting group on file creation/edit
 
I'm trying to setup some permissions on my CVS repository so that I can give a friend access to help me work on a project. My first thought was to create a cvs group, add us both to it, and then set the group of the cvs directory to cvs, with read/write permissions.

That works, but, when adding or editing files, those files show up in the CVS repository with a group of users, and owner of whoever added/modified the file. That doesn't break the access for me and my friend doing the CVS work, but it does open it up to other users on my system who I DON'T necessarily want to give write access to those files.

I could make the cvs group the primary group for us, but then every new file we create will be created with access to cvs group, which seems kind of messy.

Is there any way I can get just those files in the CVS repository to be created/modified with the cvs group automatically?

makuyl 06-17-2005 02:43 PM

You could mount a partition as the directory and use grpid as an option for it in fstab. It then creates files set to the same group that the mountpoint has.

deiussum 06-17-2005 03:53 PM

Yeah, that would work. Any other ideas that don't involve re-partitioning my system?

Noth 06-17-2005 04:29 PM

If you set the setgid bit on a directory (with chmod g+s directory), files created in that directory will have their group set to the directory's group.

deiussum 06-17-2005 04:50 PM

Thanks Noth. Exactly what I was looking for.


All times are GMT -5. The time now is 02:37 PM.