[Samba] Re: Recycler problem

Christian Marx marx at in.tum.de
Fri Jan 28 14:59:27 GMT 2005


zheka wrote:
> Christian Marx wrote:
> 
>> Hi folks,
>>
>> I have Samba 3.0.10 with SuSE 9.1 running and a problem with the 
>> recycler feature of Samba.
>>
>> Following setup:
>>
>> - User A deletes file F1 in directory D
>> - Samba produces file .recycler/D/F1
>> - D has permissions -rwx------, F1 has permissions -rwxrw-r-- (owner A)
>> - User B deletes file F2 in directory D
>> - F2 doesn't show up in .recycler/D
>>
>> So all files User B deletes in directory D are lost.
>>
>> Any suggestions on that?
>>
>> --- smb.conf
>>
>>    ...
>>
>>    create mask = 775
>>    directory mask = 0775
>>
>>    vfs objects = recycle
>>    recycle:keeptree = Yes
>>    recycle:touch = Yes
>>    recycle:versions = Yes
>>    recycle:maxsize = 0
>>    recycle:exclude = *.tmp|~$*
>>    recycle:noversions = *.doc|*.xls|*.ppt
>>
>>    ...
>>
>> --- smb.conf end
>>
>> Thanks,
>> Christian Marx
>>
> AFAIK, it's intended behaviour. See lines 216 and 234 in vfs_recycle.c.
> 2 independent ways to resolve the issue:
> 1. Set default ACL for recycle dir:
> # setfacl -d -m g:<some_group>:rwx ./.recycle
> 2. Quick and dirty patch to vfs_recycle.c:
> line 216:
> mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | IXGRP | IWGRP
> This should add rwx rights to group on newly created directories under
> .recycle

Well, that somewhat limits the use of the recycle feature, since it 
simply doesn't work on shares accessed by multiple users.

In my opinion the behaviour should be controllable via the smb.conf file.

Anyway, thanks for your thoughts, but I chose to fix this shortcoming in 
a more clumsy way, I guess. But I might check the acl stuff sometime.

--- crontab

-* * * * *      root    /usr/bin/find /srv/samba/*/.recycle -type d 
-exec /bin/chmod g+rwx {} \;

--- contab end



More information about the samba mailing list