s3:libsmb/clifile use correct value for MaxParameterCount for setting EAs
authorChristian Ambach <ambi@samba.org>
Tue, 10 May 2016 17:47:02 +0000 (19:47 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 11 May 2016 16:35:59 +0000 (18:35 +0200)
commit7efbe1139796bb708176cd8dddb206a0f271ec1b
treece1baaa6f2df1290c297febc18110b01985552bd
parent15f191a2329d08b92111f71e22f8a28c8a39c193
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
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 11 18:35:59 CEST 2016 on sn-devel-144
source3/libsmb/clifile.c