Bug 11213 - File and Directory creation modes not respected when vfs_fruit is in use
Summary: File and Directory creation modes not respected when vfs_fruit is in use
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.2.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-11 23:29 UTC by David Cole
Modified: 2015-05-21 07:55 UTC (History)
2 users (show)

See Also:


Attachments
Patch for master (2.90 KB, patch)
2015-05-08 10:15 UTC, Ralph Böhme
no flags Details
Patch for master (2.88 KB, patch)
2015-05-08 10:36 UTC, Ralph Böhme
slow: review? (metze)
jra: review+
Details
Patch for 4.2 cherry-picked from master (3.22 KB, patch)
2015-05-09 16:33 UTC, Ralph Böhme
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Cole 2015-04-11 23:29:09 UTC
I'm using Samba 4.2.0 build from the source tarball https://www.samba.org/samba/ftp/stable/samba-4.2.0.tar.gz on Ubuntu Linux 14.04 LTS and OpenIndiana Solaris oi_151a9

I'm started using vfs_fruit and I saw immediately that the new file and directory creation modes I had in my config were not being respected.  Commenting out vfs_fruit restored the new file/directory modes functionality.  I've tested this on both Ubuntu Linux and on OpenIndiana with the same results.

Specifically I need group write permissions to be in place on every new file and directory created by every user.

The striped down config that shows the issue for me:

[global]
   netbios name = TESTING
   workgroup = TEST
   security = user
   encrypt passwords = yes
   load printers = no
   printcap name = /dev/null
   disable spoolss = yes
   unix extensions = no
   strict locking = no
   wide links = no
   log level = 2

[TEST]
   path = /tank/testing/testshare
   read only = no
   create mode = 0666
   directory mode = 0777
   vfs objects = fruit

Commenting out the last line and restarting gives different group and world mode on newly created files and directories.

Thanks
Comment 1 Ralph Böhme 2015-05-08 10:09:42 UTC
"create mode" and "directory mode" are applied at file creation time and the mode is modified in subsequent setinfo with an nt acl including an MS NFS mode ACE.

The only way to achieve intended behaviour is another vfs_fruit option that disables the feature at the SMB2 AAPL extension protocol level. Patch to follow.
Comment 2 Ralph Böhme 2015-05-08 10:15:37 UTC
Created attachment 11034 [details]
Patch for master

Patch series includes a second commit fixing a comment, hope that's ok. :)
Comment 3 Ralph Böhme 2015-05-08 10:31:45 UTC
Comment on attachment 11034 [details]
Patch for master

Revoking patch and review request. Just stumpled across that the patch makes this a per share option, but that's misleading, it's a global option. Updated patch to follow.
Comment 4 Ralph Böhme 2015-05-08 10:36:37 UTC
Created attachment 11035 [details]
Patch for master

Patch series includes a second commit fixing a comment, hope that's ok. :)
Comment 5 Jeremy Allison 2015-05-08 16:38:02 UTC
Comment on attachment 11035 [details]
Patch for master

LGTM. Pushed to master.
Comment 6 Ralph Böhme 2015-05-09 16:33:43 UTC
Created attachment 11038 [details]
Patch for 4.2 cherry-picked from master
Comment 7 Jeremy Allison 2015-05-12 18:39:53 UTC
Comment on attachment 11038 [details]
Patch for 4.2 cherry-picked from master

LGTM.
Comment 8 Jeremy Allison 2015-05-12 18:40:13 UTC
Re-assigning to Karolin for inclusion in 4.2.next.
Comment 9 Karolin Seeger 2015-05-20 11:28:57 UTC
(In reply to Jeremy Allison from comment #8)
Pushed to autobuild-v4-2-test.
Comment 10 Karolin Seeger 2015-05-21 07:55:24 UTC
Pushed to v4-2-test.
Closing out bug report!

Thanks!