Port 2135dfe91bf1ae114a18c15286b535662200677d from 3.2.
authorJeremy Allison <jra@samba.org>
Fri, 28 Dec 2007 23:38:42 +0000 (15:38 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 28 Dec 2007 23:38:42 +0000 (15:38 -0800)
commitfa25c239e7624a863088008f58ed2b2f82a1cd1b
tree1edfd8f5bab21c239ac0f6547e4eed3bc4f0e653
parent30f0fb4c35f88ad3b490d52f142305e5c30f7308
Port 2135dfe91bf1ae114a18c15286b535662200677d from 3.2.
From Volker :

    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...
source/smbd/dosmode.c
source/smbd/open.c