umask, ACL inheritance and setgid +s not working with copy from flash drive in nautilus

Derek Maciel ishidableach at gmail.com
Tue Sep 14 21:16:54 UTC 2010


On 14 September 2010 16:51, Andy Graybeal <andy.graybeal at casanueva.com> wrote:
> I want to create a file on another system (at home for example), bring
> it into work, put it into my teams folder and have the ability for the
> rest of my team (group) to be able to read and write to it and "others"
> to be able to read it.
>
> I have a Tech and Finance folder.  I want each file underneath that
> folder to be owned by the group a certain group. To keep it simple, the
> 'tech' group I want to have rw access to the Tech folder recursively as
> well the Finance folder, the 'finance' group will have rw access
> recursively. I think I got this down with setguid +s.
>
> So for instance... I want all the files in a certain folder to look like
> this:
>
> -rw-rw-r--+  1 andy.graybeal      tech          0 2010-09-14 16:32 hansolo
>
> andy.graybeal at buddleia:/srv/Desktop/Tech$ getfacl hansolo
> # file: hansolo
> # owner: andy.graybeal
> # group: tech
> user::rw-
> group::rwx                      #effective:rw-
> mask::rw-
> other::r--
>
> andy.graybeal at buddleia:/srv/Desktop/Tech$
>
> So.. if someone takes a file home and works on it and brings it back, I
> think it loses it's permissions, as well as if someone creates a file on
> their system at home and brings it in to work.

So if I understand correctly, you could create a script in all
locations that could change the owner of each file depending on where
it was.

So the script in your Tech folder could do:
for file in *.*; do chown <some_user>:tech {file}; done


This would change the owner of all the files in the current directory
to <some_user> in the tech group.

I'm just not sure what I should use for <some_user>.




More information about the ubuntu-users mailing list