Project

General

Profile

Bug #74262

Set appropriate permissions on .recycle directory

Added by Bug Clerk 6 months ago. Updated 5 months ago.

Status:
Done
Priority:
No priority
Assignee:
Andrew Walker
Category:
Services
Target version:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
HUY-748-54659
Hardware Configuration:
ChangeLog Required:
No

Description

We have a TrueNAS customer that has enabled the recycle bin functionality in Samba. They are getting hammered with error messages like similar.

[2019/01/21 12:05:46.738270, 1] ../source3/modules/vfs_recycle.c:311(recycle_create_dir)
recycle: mkdir failed for .recycle/jwheat with error: Permission denied

After discussion with Andrew Walker, an idea arose to fix this by doing the following.

1. if recycle bin is enabled
2. on connect, samba will "become root" and create the user directory underneath the .recycle directory
3. after creation, samba will chown that user directory to the ad user on connect

This will get around the permissions errors related to the .recycle directory that this customer is experiencing.


Related issues

Copied from FreeNAS - Bug #73891: set appropriate permissions on .recycle directoryDone

History

#1 Updated by Bug Clerk 6 months ago

  • Copied from Bug #73891: set appropriate permissions on .recycle directory added

#2 Updated by Bug Clerk 6 months ago

  • Status changed from Unscreened to In Progress

#3 Updated by Dru Lavigne 6 months ago

  • Target version changed from Master - FreeNAS Nightlies to 11.2-U3

#4 Updated by Dru Lavigne 6 months ago

Steps to test:
1) create share with recycle checkbox checked (enabled).
2) create a test file and delete it via an SMB client.

#5 Updated by Bug Clerk 6 months ago

  • Status changed from In Progress to Ready for Testing

#6 Updated by Dru Lavigne 6 months ago

  • Subject changed from set appropriate permissions on .recycle directory to Set appropriate permissions on .recycle directory
  • Needs Merging changed from Yes to No

#7 Updated by Andrew Walker 6 months ago

I fixed this in a slightly different way than mentioned in the ticket. We were getting "permission denied" because chmod() is disallowed when extended ACLs are present when the ZFS aclmode is set to restricted. I modified vfs_recycle so that it strips the inherited extended ACL from the ".recycle" directory during creation. This allows the vfs module to work as designed.

#10 Avatar?id=55038&size=24x24 Updated by Zackary Welch 5 months ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Confirmed fixed in 11.2-U3.

#11 Updated by Dru Lavigne 5 months ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF