[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] File permissions fun
On Sun, Dec 21, 2008 at 5:57 PM, David Smith <sheflug@xxxxxxxxxxxxxxx> wrote:
>> Another way of hacking it might be to stick a "chmod g+w
>> <photodirectory>/*" in the appropriate crontab.
>>
>> For doing exactly what Dave requires, it looks as though ACLs might be needed:
>>
>> http://www.linuxformat.co.uk/index.php?name=PNphpBB2&file=viewtopic&t=9118&start=0&postdays=0&postorder=asc&highlight=
>
> I've got the ACLs sort-of working (but not quite right).
>
> I now have a folder called:
> /home/photos
> with two sub-folders:
> /home/photos/davo (for photos I import from my camera - owner set to 'davo')
> /home/photos/sarah (for photos my wife will import - owner set to 'sarah')
>
> I used the chown/chmod commands to set up the /home/photos folder to
> be in the group 'photoshare' with the 'set group id':
> drwxr-sr-x+ 4 davo photoshare 4096 2008-12-21 17:33 photos
>
> I then used the following command to set up the ACL:
> $ sudo setfacl -Rm default:group::rw photos
>
> This appears to work in so far as anything created in the
> '/home/photos/davo' folder has the following permissions:
> -rw-rw-r--+ 1 davo photoshare 6 2008-12-21 17:42 test
> and anything created in the '/home/photos/sarah' folder has the
> following permissions:
> -rw-rw-r--+ 1 sarah photoshare 5 2008-12-21 17:42 test
>
> Great! Both of us can edit the files created by each other.
>
> BUT, if either user tries to create a file in the folder owned by the
> other, I get a 'permission denied' error. e.g.:
> $ cd /home/photos/sarah (as myself)
> $ cat > test2
> bash: test2: Permission denied
>
> Is there something I am still missing?
Well to answer my own question (and just in case this helps out anyone
else who is messing around with ACLs and file permissions):
I had somewhere along the line not given group write permissions to
each of the folders that I had already created - setting the *default*
acl recursively did not affect the pre-existing access permissions.
I also should have included execute permissions in the default group
permissions (otherwise you can't go into the folders!).
Now appears to be all working, so thanks to those who helped out (and
I hope to see you at one of the Walkley Cottage meetings some time -
is there one at the start of Jan?)
Davo
_______________________________________________
Sheffield Linux User's Group
http://sheflug.org.uk/mailman/listinfo/sheflug_sheflug.org.uk
FAQ at: http://www.sheflug.org.uk/mailfaq.html
GNU - The Choice of a Complete Generation