[PATCH] Fix bug #10587 - Opening directories on SLES's cifsd and Apple's smbx succeeds.

Stefan (metze) Metzmacher metze at samba.org
Thu May 8 13:58:19 MDT 2014


Am 08.05.2014 21:06, schrieb Jeremy Allison:
> From the commit message:
> 
> ----------------------------------------------------------
> SLES's cifsd and Apple's smbx do not correctly handle FILE_NON_DIRECTORY_FILE
> which prevents recursive copies in gvfs from working correctly since GVFS
> tries to open the directory, expecting ENOTDIR, but it suceeds and appears as a
> zero byte file.
> 
> This fix adds code to the synchronous NTCreateX and NTTrans
> open code that checks if CreateOptions was requested with
> FILE_NON_DIRECTORY_FILE set, and if the attributes
> returned include FILE_ATTRIBUTE_DIRECTORY we synchronously
> close the file handle just opened, and return NT_STATUS_FILE_IS_A_DIRECTORY
> to the caller.
> ----------------------------------------------------------
> 
> Please review and push if acceptable.

I'd prefer to fix this in the callers, just let the caller get the
attributes.

This is too much magic if the cli_foo() behaves differently as
cli_foo_send/recv().

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140508/e2a0841d/attachment.pgp>


More information about the samba-technical mailing list