Bug 6133 - Cannot delete non-ACL files on Solaris/ZFS/NFSv4 ACL filesystem.
Summary: Cannot delete non-ACL files on Solaris/ZFS/NFSv4 ACL filesystem.
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: Other Solaris
: P3 regression
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 13162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-20 10:21 UTC by Jeremy Allison
Modified: 2020-12-11 07:21 UTC (History)
5 users (show)

See Also:


Attachments
Patch for 3.3.x. (1.34 KB, patch)
2009-02-20 10:22 UTC, Jeremy Allison
no flags Details
Patch for 4.6 and 4.7 cherry-picked from master (7.47 KB, patch)
2017-09-27 13:02 UTC, Ralph Böhme
jra: review+
Details
Possible patch for master (1.52 KB, patch)
2017-10-28 14:16 UTC, Ralph Böhme
no flags Details
Additional patch for 4.6 and 4.7 cherry-picked from master (1.80 KB, patch)
2017-11-02 14:15 UTC, Ralph Böhme
asn: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2009-02-20 10:21:27 UTC
As the NFSv4 ACL mapping code doesn't map write directory into the DELETE_CHILD permission bit (which we require before allowing a delete) no one can delete files without an explicit DELETE_CHILD bit set on the directory.

Reported by Jens Elkner <jel+iws@iws.cs.uni-magdeburg.de>
Comment 1 Jeremy Allison 2009-02-20 10:22:35 UTC
Created attachment 3948 [details]
Patch for 3.3.x.
Comment 2 Jeremy Allison 2009-02-20 10:27:46 UTC
Fixed in all branches 3.2.x and above.
Jeremy.
Comment 3 Ralph Böhme 2017-09-06 14:15:44 UTC
This bugfix has put a fix for a ZFS-only idiosyncrasy into the generic NFS4 framework. This is not the right place, it's eg wrong for GPFS and prevents properly managing ACLs    from Windows clients. Certain vendors carry a patch that reverts this change...

Will post a fix that moves the change to ZFS-only.
Comment 5 Ralph Böhme 2017-09-27 13:02:04 UTC
Created attachment 13638 [details]
Patch for 4.6 and 4.7 cherry-picked from master
Comment 6 Jeremy Allison 2017-09-30 00:59:22 UTC
Re-assigning to Karolin for inclusion in 4.7.next, 4.6.next.
Comment 7 Karolin Seeger 2017-10-24 07:51:30 UTC
(In reply to Jeremy Allison from comment #6)
Pushed to autobuild-v4-{7,6}-test.
Comment 8 Ralph Böhme 2017-10-28 14:16:57 UTC
Created attachment 13735 [details]
Possible patch for master
Comment 9 Mike 2017-10-28 19:17:48 UTC
compiled with latest patch 2017-10-28 14:16 UTC, on freebsd 11.1 and samba 4.6.9.

compile error is resolved but samba usage is impossible for me.
when i try to connect with windows 10 client is get this in log:

Oct 28 20:37:15 giganas smbd[6174]: [2017/10/28 20:37:15.207829,  2] ../source3/smbd/process.c:2876(deadtime_fn)
Oct 28 20:37:15 giganas smbd[6174]:   Closing idle connection
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.162592,  0] ../lib/util/fault.c:78(fault_report)
Oct 28 20:37:16 giganas smbd[6265]:   ===============================================================
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.163103,  0] ../lib/util/fault.c:79(fault_report)
Oct 28 20:37:16 giganas smbd[6265]:   INTERNAL ERROR: Signal 11 in pid 6265 (4.6.9)
Oct 28 20:37:16 giganas smbd[6265]:   Please read the Trouble-Shooting section of the Samba HOWTO
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.163362,  0] ../lib/util/fault.c:81(fault_report)
Oct 28 20:37:16 giganas smbd[6265]:   ===============================================================
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.163535,  0] ../source3/lib/util.c:791(smb_panic_s3)
Oct 28 20:37:16 giganas smbd[6265]:   PANIC (pid 6265): internal error
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.179301,  0] ../source3/lib/util.c:902(log_stack_trace)
Oct 28 20:37:16 giganas smbd[6265]:   BACKTRACE: 7 stack frames:
Oct 28 20:37:16 giganas smbd[6265]:    #0 0x8046bec5e <log_stack_trace+0x1e> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:16 giganas smbd[6265]:    #1 0x8046bea58 <smb_panic_s3+0x98> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:16 giganas smbd[6265]:    #2 0x80211d4c7 <smb_panic+0x27> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:16 giganas smbd[6265]:    #3 0x80211da70 <string_sub_once> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:16 giganas smbd[6265]:    #4 0x80211d493 <fault_setup+0x73> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:16 giganas smbd[6265]:    #5 0x801cd8926 <pthread_sigmask+0x536> at /lib/libthr.so.3
Oct 28 20:37:16 giganas smbd[6265]:    #6 0x801cd7ecf <pthread_getspecific+0xe5f> at /lib/libthr.so.3
Oct 28 20:37:16 giganas smbd[6265]: [2017/10/28 20:37:16.180372,  0] ../source3/lib/dumpcore.c:310(dump_core)
Oct 28 20:37:16 giganas smbd[6265]:   unable to change to %N.core
Oct 28 20:37:16 giganas smbd[6265]:   refusing to dump core
Oct 28 20:37:16 giganas smbd[6157]: [2017/10/28 20:37:16.208039,  1] ../source3/smbd/server.c:878(remove_child_pid)
Oct 28 20:37:16 giganas smbd[6157]:   Scheduled cleanup of brl and lock database after unclean shutdown
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.077798,  0] ../lib/util/fault.c:78(fault_report)
Oct 28 20:37:17 giganas smbd[6266]:   ===============================================================
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.078391,  0] ../lib/util/fault.c:79(fault_report)
Oct 28 20:37:17 giganas smbd[6266]:   INTERNAL ERROR: Signal 11 in pid 6266 (4.6.9)
Oct 28 20:37:17 giganas smbd[6266]:   Please read the Trouble-Shooting section of the Samba HOWTO
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.078653,  0] ../lib/util/fault.c:81(fault_report)
Oct 28 20:37:17 giganas smbd[6266]:   ===============================================================
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.078825,  0] ../source3/lib/util.c:791(smb_panic_s3)
Oct 28 20:37:17 giganas smbd[6266]:   PANIC (pid 6266): internal error
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.094654,  0] ../source3/lib/util.c:902(log_stack_trace)
Oct 28 20:37:17 giganas smbd[6266]:   BACKTRACE: 7 stack frames:
Oct 28 20:37:17 giganas smbd[6266]:    #0 0x8046bec5e <log_stack_trace+0x1e> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:17 giganas smbd[6266]:    #1 0x8046bea58 <smb_panic_s3+0x98> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:17 giganas smbd[6266]:    #2 0x80211d4c7 <smb_panic+0x27> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:17 giganas smbd[6266]:    #3 0x80211da70 <string_sub_once> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:17 giganas smbd[6266]:    #4 0x80211d493 <fault_setup+0x73> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:17 giganas smbd[6266]:    #5 0x801cd8926 <pthread_sigmask+0x536> at /lib/libthr.so.3
Oct 28 20:37:17 giganas smbd[6266]:    #6 0x801cd7ecf <pthread_getspecific+0xe5f> at /lib/libthr.so.3
Oct 28 20:37:17 giganas smbd[6266]: [2017/10/28 20:37:17.095729,  0] ../source3/lib/dumpcore.c:310(dump_core)
Oct 28 20:37:17 giganas smbd[6266]:   unable to change to %N.core
Oct 28 20:37:17 giganas smbd[6266]:   refusing to dump core
Oct 28 20:37:36 giganas smbd[6161]: [2017/10/28 20:37:36.261808,  1] ../source3/smbd/smbd_cleanupd.c:99(smbd_cleanupd_unlock)
Oct 28 20:37:36 giganas smbd[6161]:   smbd_cleanupd_unlock: Cleaning up brl and lock database after unclean shutdown
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.986585,  0] ../lib/util/fault.c:78(fault_report)
Oct 28 20:37:36 giganas smbd[6285]:   ===============================================================
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.986800,  0] ../lib/util/fault.c:79(fault_report)
Oct 28 20:37:36 giganas smbd[6285]:   INTERNAL ERROR: Signal 11 in pid 6285 (4.6.9)
Oct 28 20:37:36 giganas smbd[6285]:   Please read the Trouble-Shooting section of the Samba HOWTO
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.986943,  0] ../lib/util/fault.c:81(fault_report)
Oct 28 20:37:36 giganas smbd[6285]:   ===============================================================
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.987024,  0] ../source3/lib/util.c:791(smb_panic_s3)
Oct 28 20:37:36 giganas smbd[6285]:   PANIC (pid 6285): internal error
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.994013,  0] ../source3/lib/util.c:902(log_stack_trace)
Oct 28 20:37:36 giganas smbd[6285]:   BACKTRACE: 7 stack frames:
Oct 28 20:37:36 giganas smbd[6285]:    #0 0x8046bec5e <log_stack_trace+0x1e> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:36 giganas smbd[6285]:    #1 0x8046bea58 <smb_panic_s3+0x98> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:36 giganas smbd[6285]:    #2 0x80211d4c7 <smb_panic+0x27> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:36 giganas smbd[6285]:    #3 0x80211da70 <string_sub_once> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:36 giganas smbd[6285]:    #4 0x80211d493 <fault_setup+0x73> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:36 giganas smbd[6285]:    #5 0x801cd8926 <pthread_sigmask+0x536> at /lib/libthr.so.3
Oct 28 20:37:36 giganas smbd[6285]:    #6 0x801cd7ecf <pthread_getspecific+0xe5f> at /lib/libthr.so.3
Oct 28 20:37:36 giganas smbd[6285]: [2017/10/28 20:37:36.994478,  0] ../source3/lib/dumpcore.c:310(dump_core)
Oct 28 20:37:36 giganas smbd[6285]:   unable to change to %N.core
Oct 28 20:37:36 giganas smbd[6285]:   refusing to dump core
Oct 28 20:37:37 giganas smbd[6157]: [2017/10/28 20:37:37.007304,  1] ../source3/smbd/server.c:878(remove_child_pid)
Oct 28 20:37:37 giganas smbd[6157]:   Scheduled cleanup of brl and lock database after unclean shutdown
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.838639,  0] ../lib/util/fault.c:78(fault_report)
Oct 28 20:37:37 giganas smbd[6286]:   ===============================================================
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.838760,  0] ../lib/util/fault.c:79(fault_report)
Oct 28 20:37:37 giganas smbd[6286]:   INTERNAL ERROR: Signal 11 in pid 6286 (4.6.9)
Oct 28 20:37:37 giganas smbd[6286]:   Please read the Trouble-Shooting section of the Samba HOWTO
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.838819,  0] ../lib/util/fault.c:81(fault_report)
Oct 28 20:37:37 giganas smbd[6286]:   ===============================================================
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.838859,  0] ../source3/lib/util.c:791(smb_panic_s3)
Oct 28 20:37:37 giganas smbd[6286]:   PANIC (pid 6286): internal error
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.842688,  0] ../source3/lib/util.c:902(log_stack_trace)
Oct 28 20:37:37 giganas smbd[6286]:   BACKTRACE: 7 stack frames:
Oct 28 20:37:37 giganas smbd[6286]:    #0 0x8046bec5e <log_stack_trace+0x1e> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:37 giganas smbd[6286]:    #1 0x8046bea58 <smb_panic_s3+0x98> at /usr/local/lib/libsmbconf.so.0
Oct 28 20:37:37 giganas smbd[6286]:    #2 0x80211d4c7 <smb_panic+0x27> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:37 giganas smbd[6286]:    #3 0x80211da70 <string_sub_once> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:37 giganas smbd[6286]:    #4 0x80211d493 <fault_setup+0x73> at /usr/local/lib/libsamba-util.so.0
Oct 28 20:37:37 giganas smbd[6286]:    #5 0x801cd8926 <pthread_sigmask+0x536> at /lib/libthr.so.3
Oct 28 20:37:37 giganas smbd[6286]:    #6 0x801cd7ecf <pthread_getspecific+0xe5f> at /lib/libthr.so.3
Oct 28 20:37:37 giganas smbd[6286]: [2017/10/28 20:37:37.842925,  0] ../source3/lib/dumpcore.c:310(dump_core)
Oct 28 20:37:37 giganas smbd[6286]:   unable to change to %N.core
Oct 28 20:37:37 giganas smbd[6286]:   refusing to dump core
Oct 28 20:37:39 giganas smbd[6157]: [2017/10/28 20:37:39.348000,  0] ../source3/smbd/server.c:972(smbd_accept_connection)
Oct 28 20:37:39 giganas smbd[6157]:   accept: Software caused connection abort
Oct 28 20:37:57 giganas smbd[6161]: [2017/10/28 20:37:57.038680,  1] ../source3/smbd/smbd_cleanupd.c:99(smbd_cleanupd_unlock)
Oct 28 20:37:57 giganas smbd[6161]:   smbd_cleanupd_unlock: Cleaning up brl and lock database after unclean shutdown
Oct 28 20:38:15 giganas smbd[6263]: [2017/10/28 20:38:15.233493,  2] ../source3/smbd/process.c:2876(deadtime_fn)
Oct 28 20:38:15 giganas smbd[6263]:   Closing idle connection
Oct 28 20:39:15 giganas smbd[6325]: [2017/10/28 20:39:15.303686,  2] ../source3/smbd/process.c:2876(deadtime_fn)
Oct 28 20:39:15 giganas smbd[6325]:   Closing idle connection
Comment 10 Ralph Böhme 2017-10-29 10:23:00 UTC
(In reply to Mike from comment #9)
Looks like a different issue, please file a new PR. Thanks!
Comment 11 Ralph Böhme 2017-11-02 14:15:42 UTC
Created attachment 13750 [details]
Additional patch for 4.6 and 4.7 cherry-picked from master
Comment 12 Jorge Schrauwen 2017-11-03 15:09:06 UTC
Looks like the patch with id 13638 brakes compilation of vfs_zfsacl.

I get this error now in the linking stage:

Waf: Leaving directory `/home/pbulk/build/pbd/samba-pbd/work/samba-4.7.1/bin'
Build failed:
 -> task failed (err #1):
        {task: cc vfs_zfsacl.c -> vfs_zfsacl_40.o}
Missing node signature for bld:///home/pbulk/build/pbd/samba-pbd/work/samba-4.7.1/source3/modules/vfs_zfsacl_40.o (required by
        {task: cc_link nfs4_acls_1.o,vfs_zfsacl_40.o -> libvfs_module_zfsacl.so})

Which can be traced back to this error in the compiling stage:

../source3/modules/vfs_zfsacl.c: In function 'zfs_get_nt_acl_common':
../source3/modules/vfs_zfsacl.c:69:37: error: 'ace' undeclared (first use in this function)
  if (S_ISDIR(psbuf->st_ex_mode) && (ace->aceMask & SMB_ACE4_ADD_FILE)) {
                                     ^
../source3/modules/vfs_zfsacl.c:69:37: note: each undeclared identifier is reported only once for each function it appears in

In the patch with id 13638 the very last change introduces an action on the 'ace' object which does not seem to be set or even declared at that point.

Unfortunately I am not well versed enough in C, well more specifically the samba vfs sub system.

(I'm happy to test potential patches though, I have a build server setup were I compile samba on for SmartOS/illumos)
Comment 13 Ralph Böhme 2017-11-03 15:15:01 UTC
(In reply to Jorge Schrauwen from comment #12)
Fixed by attachment 13750 [details].
Comment 14 Jorge Schrauwen 2017-11-03 15:37:59 UTC
Ah let me try with that one applied as it looks like it did not make it into 4.7.1
Comment 15 Jorge Schrauwen 2017-11-03 16:56:31 UTC
(In reply to Ralph Böhme from comment #13)
Everything looks good with that additional patch applied.
Compiled and my setup that uses zfsacl still seems to work.
Comment 16 Ralph Böhme 2017-12-05 09:18:49 UTC
Comment on attachment 13750 [details]
Additional patch for 4.6 and 4.7 cherry-picked from master

Can someone please ACK the backport? Thanks!
Comment 17 Ralph Böhme 2017-12-06 13:59:33 UTC
Reassigning to Karolin for inclusion in 4.6 and 4.7.

Karolin, the earlier patchset for 4.6 and 4.7 that you already pushed to the branches caused a regression (build-failure) on FreeBSD.

The "additional patch" fixes that...
Comment 18 Karolin Seeger 2017-12-07 09:04:18 UTC
(In reply to Ralph Böhme from comment #17)
Pushed additional patch to autobuild-v4-{7,6}-test.
Comment 19 Karolin Seeger 2017-12-14 11:22:24 UTC
Pushed to both branches.
Closing out bug report.

Thanks!
Comment 20 Jura Sasek 2018-02-05 09:42:16 UTC
*** Bug 13162 has been marked as a duplicate of this bug. ***