summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-10 16:26:23 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-10 16:26:23 +0100
commitfd4061daddc33085855f24dd7f36f0038daaeabb (patch)
tree30ce3de288885d63d7bde898b07da58048977dd4 /source4/rpc_server
parentcee83ac34a257a6f2090077ef2e8a6f888783f03 (diff)
downloadsamba-fd4061daddc33085855f24dd7f36f0038daaeabb.tar.gz
samba-fd4061daddc33085855f24dd7f36f0038daaeabb.tar.bz2
samba-fd4061daddc33085855f24dd7f36f0038daaeabb.zip
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.
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c30
1 files changed, 27 insertions, 3 deletions
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;