From fd4061daddc33085855f24dd7f36f0038daaeabb Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 10 Nov 2009 16:26:23 +0100 Subject: s4:dcesrv_samr - Add more checks for invalid levels Add more checks on valid levels, mark unimplemented ones as "UNSUPPORTED" and otherwise as "INVALID_INFO_CLASS" to be safe. --- source4/rpc_server/samr/dcesrv_samr.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 641b35c2da..0b102b5e79 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -797,8 +797,10 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, break; } case 9: + { attrs = NULL; - break; + break; + } case 11: { static const char * const attrs2[] = { "oEMInformation", @@ -828,6 +830,10 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, attrs = attrs2; break; } + default: + { + return NT_STATUS_INVALID_INFO_CLASS; + } } /* some levels don't need a search */ @@ -881,9 +887,9 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, case 13: return dcesrv_samr_info_DomInfo13(d_state, mem_ctx, dom_msgs, &info->info13); + default: + return NT_STATUS_INVALID_INFO_CLASS; } - - return NT_STATUS_INVALID_INFO_CLASS; } @@ -3148,6 +3154,10 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA attrs = attrs2; break; } + case 18: + { + return NT_STATUS_NOT_SUPPORTED; + } case 20: { static const char * const attrs2[] = {"userParameters", @@ -3183,6 +3193,17 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA attrs = attrs2; break; } + case 23: + case 24: + case 25: + case 26: + { + return NT_STATUS_NOT_SUPPORTED; + } + default: + { + return NT_STATUS_INVALID_INFO_CLASS; + } } /* pull all the user attributes */ @@ -4401,6 +4422,9 @@ static NTSTATUS dcesrv_samr_ValidatePassword(struct dcesrv_call_state *dce_call, pwInfo.min_password_length); (*r->out.rep)->ctr3.status = res; break; + default: + return NT_STATUS_INVALID_INFO_CLASS; + break; } return NT_STATUS_OK; -- cgit