01-07-07 01:01 AM
"fazlin" <fazlincse@gmail.com> writes:
> Hi all,
>
> This may be a silly question but plz help me out on this.
>
> I have a directory that is group writable and if i create/copy a file
> in the directory, it has the following permissions:
>
> -rw-r--r-- 1 fazlin ukp 0 Jan 4 13:10 test
>
> The issue is that whenever i create/copy files in that directory it has
> to be group writable.
>
> Plz lemme know the possible solutions.
The users must set their umask to 002 to have the files created with 664.
With a directory that is group writeable, the users of the group can
still rename and delete that file. So you may change your application
to do that, instead of trying to append or overwrite the files (at
least when it hasn't write access right on the file).
Or, you could have a daemon that watches for bad access rights in the
directory, and set them right.
A worst case alternative is to make the program suid. (the program
that needs to update or overwrite these files, if this is a specific
program).
Also, instead of letting users do random things in this directory,
restrict its access rights and provide a specific tool to access it
(to copy or update files in it). You can set the directory 700 and
use a specific owner, and the tool can be owned by the same specific
owner and suid. So normal users cannot access the contents of the
directory, and the tool can set the access rights as it wants.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"This statement is false." In Lisp: (defun Q () (eq nil (Q)))
[ Post a follow-up to this message ]
|