[PATCH] Fix Bug 11354

Jeremy Allison jra at samba.org
Wed May 11 13:07:22 UTC 2016


On Wed, May 11, 2016 at 03:00:11PM +0200, Christian Ambach wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Am 11.05.16 um 14:36 schrieb Jeremy Allison:
> > Looking in MS-CIFS it says that the max data response length is
> > zero, not 2. (section 2.2.6.7.2).
> > 
> > So couldn't this be:
> > 
> >>> +                        data,  data_len, 0
> > instead ?
> > 
> 
> You're right. I misinterpreted the parameter size
> as data size.
> 
> Corrected patch attached (still works in my tests against Windows).

LGTM, pushed !

> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iQIcBAEBCAAGBQJXMyzQAAoJEO82xV3lz0qduiIQAIcatgyLmLDa0H45WWmX4rY8
> sNbb+NwsN25NGwR/CE286um9Gn7MUkgzBkuL6IUqLB0/0r5xBzWwbCOAe5A3aaQQ
> +AmPVhFjbsx/03/4LK/lT660uko0dYa9uKP545ka+5O3b7p7bNb8tYZRihcM9qak
> SfohqVjjLahi+nbK5wDOF2d4q2ZdIv00mOxkfg+EOOTc7AUjcnHlOgH0YqNsRIiU
> cStO5LPB9ELtfPSt0sPW1f40UHV28I3P8pnEuICPrFKokjFAYykNXTsKfNpcGRvE
> PNN4yZAZLpibJQVHUC//h76Wyyf8mzgOnylyjTcrfnbGYKUs0tWhbF/W47yYU/rO
> 03kf0Xzu1jDqGy5tvVvtV4lBU2hD58wTE2jwM1nkakMm+mLeEg9b43ugVLPntwqr
> UwCNWxeH/bt4GT1hu7Gy71g3u/A3671KtsDTlRHEh/Cd32H2ZC2ihkDJxeNqpIfg
> jRyIwE31szyltCBw4043NF+ql50n3jqSjcMNu0jjxvN2kN8azjV8g4fZTRyzyNbB
> 3Vulw38J0i+rcsspuMmr7l8xtu3FNqsMZoC69VLUuVPi9VFd+dvR6H/dl9fCrZzW
> +z6dOkDybJ58+gkdLLV1xOvTX2aR28fHsCWc66TJs1xTvF3f9lF0/B8P0VdmRBh+
> 5rUl0XBByJAj/crsJg+N
> =M9Hj
> -----END PGP SIGNATURE-----

> From 8ce68a14c564ad2933bb8eb58b5ec0c7713fc7b3 Mon Sep 17 00:00:00 2001
> From: Christian Ambach <ambi at samba.org>
> Date: Tue, 10 May 2016 19:47:02 +0200
> Subject: [PATCH] s3:libsmb/clifile use correct value for MaxParameterCount for
>  setting EAs
> 
> Windows servers will refuse trans2 requests which use excessive
> request parameters. From [MS-CIFS|:
> <239> Section 3.3.5.2.5: Windows NT servers fail a transaction request with
> STATUS_INSUFF_SERVER_RESOURCES, if (SetupCount + MaxSetupCount +
> TotalParameterCount + MaxParameterCount + TotalDataCount + MaxDataCount)
> is greater than 65*1024.
> 
> When attempting to set a large list of EAs for a file, this limit can be
> hit when using CLI_BUFFER_SIZE as MaxDataCount
> while the TRANS2_SET_PATH_INFORMATION response has no data reply,
> only parameters (section 2.2.6.7.2).
> 
> Be as minimal as possible here to allow a maximum number of EAs to
> be written.
> 
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11354
> 
> Signed-off-by: Christian Ambach <ambi at samba.org>
> ---
>  source3/libsmb/clifile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
> index 0e790cd..684f263 100644
> --- a/source3/libsmb/clifile.c
> +++ b/source3/libsmb/clifile.c
> @@ -4593,7 +4593,7 @@ static NTSTATUS cli_set_ea(struct cli_state *cli, uint16_t setup_val,
>  	status = cli_trans(talloc_tos(), cli, SMBtrans2, NULL, -1, 0, 0,
>  			   setup, 1, 0,
>  			   param, param_len, 2,
> -			   data,  data_len, CLI_BUFFER_SIZE,
> +			   data,  data_len, 0,
>  			   NULL,
>  			   NULL, 0, NULL, /* rsetup */
>  			   NULL, 0, NULL, /* rparam */
> -- 
> 1.9.1
> 




More information about the samba-technical mailing list