Fix setting the initial permission bits
authorVolker Lendecke <vl@samba.org>
Thu, 27 Dec 2007 20:31:08 +0000 (21:31 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 28 Dec 2007 07:52:29 +0000 (08:52 +0100)
commit33f01360e0a40f6d1fa03035979d816ff9198d85
tree4547dd3c84b81e66062a4c4e36dfd6f4b02d0415
parent675f41dc144fc0c150b44d931a9242f1ac1ebe5f
Fix setting the initial permission bits

This fixes a make test failure on Solaris. When creating a new file,
file_set_dosmode() called from open_file_ntcreate calculates a new permission
mask, very likely different from what had been calculated in
open_file_ntcreate. Further down we overwrote the newly calculated value with
SMB_FCHMOD_ACL, ignoring what file_set_dosmode had calculated.

Why did Linux not see this? fchmod_acl on a newly created file without acls
would not retrieve an acl at all, whereas under Solaris acl(2) returns
something even for files with just posix permissions returns something.

Jeremy, given that we have very similar code in 3.0.28 this might also explain
some of the bug reports that people have concerning ACLs on new files.

Volker

P.S: This one took a while to find...
(This used to be commit 2135dfe91bf1ae114a18c15286b535662200677d)
source3/smbd/dosmode.c
source3/smbd/open.c