What should happen when directory creation is only partially successful - not 4 copies of the directory?

Jeremy Allison jra at samba.org
Fri Oct 28 17:51:34 UTC 2016


On Thu, Oct 27, 2016 at 11:03:40PM -0500, Steve French wrote:
> Ran into an interesting scenario, that causes Windows explorer to
> create four copies of a new directory when the user thinks directory
> creation has failed - not sure how likely it is in practice but saw
> the following if you set particular permissions (basically parent
> directory allows things to be created under it, but the inherited
> permissions for children don't allow that user or group to read the
> file or its attributes).
> 
> Going into exploer and clicking new results in a series of create
> (directory) calls which appear to fail, but which end up creating four
> directories e.g. "New folder (1)" through "New folder (4)"   (The
> server is Samba 4.5.1, various Windows clients - I was experimenting
> with Windows 8.1, but later clients fail too)
> 
> An example of what you see in the log (stripping some boring ctdb stuff out):
> 
> Windows checks if directory ("New folder (17)" in the case below)
> exists - which it doesn't.  So it sends a create (directory, sharing =
> none) request:
> 
> Directory gets created ok:
> [2016/10/27 03:56:34.629381,  5] ../source3/smbd/open.c:3460(open_directory)
>   open_directory: opening directory New folder (17), access_mask =
> 0x17019b, share_access = 0x0 create_options = 0x1, create_disposition
> = 0x2, file_attributes = 0x10
> [2016/10/27 03:56:34.629417,  5] ../source3/smbd/dosmode.c:206(unix_mode)
>   unix_mode: unix_mode(New folder (17)) returning 0777
> 
> But we return an error on the create call (presumably because we don't
> have permissions):
> 
> [2016/10/27 03:56:34.648221,  5] ../source3/smbd/files.c:128(file_new)
>   allocated file structure fnum 2475839843 (3 used)
> 
> [2016/10/27 03:56:34.649379,  5] ../source3/smbd/open.c:3661(open_directory)
>   open_directory: Could not open fd for New folder (17)
> (NT_STATUS_ACCESS_DENIED)

OK - this can happen if the parent perms allow create,
but the inherited ones don't allow any of the:

	FILE_LIST_DIRECTORY|
	FILE_ADD_FILE|
	FILE_ADD_SUBDIRECTORY|
	FILE_TRAVERSE|
	DELETE_ACCESS|
	FILE_DELETE_CHILD

we've done the create, but the fd_open(conn, fsp, O_RDONLY|O_DIRECTORY, 0);
then fails.

Can you log a bug here please and I'll look into a correct
fix for this.



More information about the samba-technical mailing list