views:

230

answers:

1

Hello!

I'm in a FreeBSD-environment where we have one server that acts as a file-server. Now we have a problem that our SYS-admin says can not be fixed.

All or files resides in a folder and we all have access to that folder and its subfolders and files. The problem is that once I,or another user in our group, creates a file or folder we have to chmod that folder or file to change the rights so that others in our group can access and read/write and delete those files.

My thought is this: it just can not be true! How can this be impossible? Our SYS-admin knows about umask but still says it is impossible. I do not have enough knowledge about these things but to me it really sounds weird that it is impossible. Mind you: these are not files in our home-directories but in a folder where we are supposed to work with them on a daily basis.

Please help me gather information so I can guide him onto the right path, please...

A: 

I think what you want is a setgid bit on the directories and umask. Then newly created there files and directories will have proper group and proper permissions to let others read abd write them.

find /your-files-are-rooted-here -type d -print0 | xargs -0 chmod ug+rw,g+s

and set umask to 002 (or whatever is appropriate). And, of course, you may want to fix permissions for existing files (the command above only takes care of directories).

Michael Krelin - hacker
This does not seem to do the trick: new files and folder still needs to be chmodded... Or our sys-admin did it wrong.
Nada
Having to `chmod` them (as opposed to `chown`) sounds like the lack of effective `umask` setting.
Michael Krelin - hacker
The weird thing is this: if I'm using expandrive and letting say textmate create a file, it gets rw-r--r-- ... but if I use touch in the terminal to create the file, the file gets rw-rw-r--Sorry to trouble you so much but since my sys-admin can not fix this, and it drives me crazy, I turn to stackoverflow... and you mr 'hacker' ofcourse!
Nada
I have no idea what are expandrive, but my guess is - it is a kind of `ftp`/`sftp`/`smb`/whatever client. That means, that your sysadmin has set umask for the normal logins, but either forgot to do that with remote file access service or it is not possible (I have no idea which is the case). In the latter case it may be *your* responsibility to ensure the proper umask is in effect. But I'd start off asking sysadmin whether he can take care of it on the service level.
Michael Krelin - hacker