[PATCH] SMB2 AAPL create context

Stefan (metze) Metzmacher metze at samba.org
Thu Sep 11 08:20:23 MDT 2014


Hi Ralphh,

I think I found a little bug in your code...

Am 11.09.2014 um 15:22 schrieb Ralph Böhme:
> +
> +		if (aapl) {
> +			/* We know we have a SMB2_CRTCTX_AAPL_SERVER_QUERY query */
> +			bool ok;
> +			uint8_t p[8];

This should be p[16];

> +			DATA_BLOB blob = data_blob_talloc(smb2req, NULL, 0);
> +			uint64_t req_bitmap, client_caps;
> +			uint64_t server_caps = SMB2_CRTCTX_AAPL_UNIX_BASED;
> +
> +			req_bitmap = BVAL(aapl->data.data, 8);
> +			client_caps = BVAL(aapl->data.data, 16);
> +
> +			SIVAL(&p, 0, SMB2_CRTCTX_AAPL_SERVER_QUERY);
> +			SIVAL(&p, 4, 0);
> +			SBVAL(&p, 8, req_bitmap);

This should be

			SIVAL(p, 0, SMB2_CRTCTX_AAPL_SERVER_QUERY);
			SIVAL(p, 4, 0);
			SBVAL(p, 8, req_bitmap);

'p' vs. &p also in other places...

> 			if (req_bitmap & SMB2_CRTCTX_AAPL_SERVER_CAPS) {
> +				if ((client_caps & SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR) &&
> +				    (smb2req->tcon->compat->fs_capabilities & FILE_NAMED_STREAMS)) {
> +					server_caps |= SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR;
> +					smb2req->tcon->compat->smb2_crtctx_aapl_readdir_attr = true;
> +				}

Is it really correct to store smb2_crtctx_aapl_readdir_attr on the tree
connect?
I'd expect that this is relative to the currently opened handle.

Is it really possible to ask for this on every file and directory?
What is with printer shares or IPC$?

Can you write some torture tests which prove the correct behavior?

Thanks!
metze

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


More information about the samba-technical mailing list