Bug 9254 - DsExecuteKCC returns wrong error code if taskid != 0
Summary: DsExecuteKCC returns wrong error code if taskid != 0
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.0.0rc2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 06:20 UTC by Matthieu Patou
Modified: 2012-10-15 09:57 UTC (History)
1 user (show)

See Also:


Attachments
Proposed patch to fix the problem (972 bytes, patch)
2012-10-13 06:53 UTC, Matthieu Patou
abartlet: review+
metze: review+
kai: review+
mat: review? (jra)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2012-10-08 06:20:14 UTC
Specification indicate that the return code should be INVALID_PARAM if taskid != 0
Comment 1 Matthieu Patou 2012-10-13 06:53:27 UTC
Created attachment 8054 [details]
Proposed patch to fix the problem

it checks for a taskid != 0 and return appropriate error code
Comment 2 Matthieu Patou 2012-10-13 07:55:06 UTC
The specification is in MS-DRSR.pdf:

4.1.6.3 Server Behavior of the IDL_DRSExecuteKCC Method
If an error occurs, a Windows error code is returned. If successful, the method returns 0.
msgIn: DRS_MSG_KCC_EXECUTE_V1
ValidateDRSInput(hDrs, 18)
IN
ULONG
IDL_DRSExecuteKCC(
[in, ref] DRS_HANDLE hDrs,
[in] DWORD dwInVersion,
[in, ref, switch_is(dwInVersion)]
DRS_MSG_KCC_EXECUTE *pmsgIn)
Informative summary of behavior: The IDL_DRSExecuteKCC method triggers the execution of
tasks that generate and maintain the replication topology between DCs.<14> See [MS-ADTS]
section 6.2.2 for more information related to the tasks performed by the KCC upon receipt of an
IDL_DRSExecuteKCC request.
msgIn := pmsgIn^.V1
/* Validate the request version */
if dwInVersion ≠ 1 then
return ERROR_DS_DRA_INVALID_PARAMETER
endif
Comment 3 Matthieu Patou 2012-10-13 08:02:16 UTC
it seems that there is a mistake in the copy and paste:

after 
msgIn := pmsgIn^.V1
/* Validate the request version */
if dwInVersion ≠ 1 then
return ERROR_DS_DRA_INVALID_PARAMETER
endif

There should be: 

if msgIn.dwTaskID ≠ 0 then
return ERROR_INVALID_PARAMETER
endif
Comment 4 Kai Blin 2012-10-13 08:04:40 UTC
Comment on attachment 8054 [details]
Proposed patch to fix the problem

Based on our discussion on IRC, looks reasonable
Comment 5 Kai Blin 2012-10-13 08:08:11 UTC
Patch applies as-is to v4-0-test, Karolin, please pick for rc3.
Comment 6 Stefan Metzmacher 2012-10-15 06:32:31 UTC
Comment on attachment 8054 [details]
Proposed patch to fix the problem

Looks good
Comment 7 Karolin Seeger 2012-10-15 09:57:39 UTC
Pushed to autobuild-v4-0-test.
Closing out bug report.

Thanks!