s3:smbd: only pass UCF_PREP_CREATEFILE to filename_convert() if we may create a new...
authorStefan Metzmacher <metze@samba.org>
Thu, 13 Oct 2016 10:42:59 +0000 (12:42 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 25 Oct 2016 03:33:36 +0000 (05:33 +0200)
commit759416582c54a16aacbef0e0dfe4649bddff8c5e
tree9f168eef3298e2162773f0aacde0ecde37723ba8
parent3f82db56cbf2727abd465e28ac02ad2242b47c29
s3:smbd: only pass UCF_PREP_CREATEFILE to filename_convert() if we may create a new file

This fixes a regression introduced by commit
f98d10af2a05f0261611f4cabdfe274cd9fe91c0
(smbd: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve a path for open)

The main problem was that Windows client seem to verify
the access to user.V2\ntuser.ini is rejected with NT_STATUS_ACCESS_DENIED,
using the machine credentials.

Passing UCF_PREP_CREATEFILE to filename_convert() triggers a code path
that implements a dropbox behaviour. A dropbox is a directory with only -wx permissions,
so get_real_filename fails with EACCESS, it needs to list the directory.
EACCESS is ignored with UCF_PREP_CREATEFILE.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 25 05:33:36 CEST 2016 on sn-devel-144
source3/smbd/filename.c
source3/smbd/nttrans.c
source3/smbd/proto.h
source3/smbd/reply.c
source3/smbd/smb2_create.c