[PATCH] HRP accepts invalid references

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1198880883 28800 # Node ID e84ead6a0242ecb1cf63e871da8603d38233ff41 # Parent 3ea63b2076c1d02b7c3c48910809b9fb11ee290f HRP accepts invalid references. Add a get_host_cs() call to pool_to_sys() handler. The get_host_cs() call will verify whether the reference passed in is valid. This patch is dependant on the "#2 EAFP and RAFP support invalid references" patchset. Failing query: wbemcli gi 'http://localhost/root/virt:Xen_MemoryPool.InstanceID="wrong"' Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 3ea63b2076c1 -r e84ead6a0242 src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Fri Dec 21 10:58:37 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Fri Dec 28 14:28:03 2007 -0800 @@ -43,8 +43,13 @@ static CMPIStatus pool_to_sys(const CMPI { CMPIInstance *host; CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; if (!match_hypervisor_prefix(ref, info)) + return s; + + s = get_pool_inst(_BROKER, ref, &inst); + if ((s.rc != CMPI_RC_OK) || (inst == NULL)) return s; s = get_host_cs(_BROKER, ref, &host);

KR> Add a get_host_cs() call to pool_to_sys() handler. The KR> get_host_cs() call will verify whether the reference passed in is KR> valid. Should this be "get_pool_inst()"? KR> Failing query: KR> wbemcli gi 'http://localhost/root/virt:Xen_MemoryPool.InstanceID="wrong"' Is "pool_to_sys()" really being run on a GetInstance call? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
KR> Add a get_host_cs() call to pool_to_sys() handler. The KR> get_host_cs() call will verify whether the reference passed in is KR> valid.
Should this be "get_pool_inst()"?
KR> Failing query: KR> wbemcli gi 'http://localhost/root/virt:Xen_MemoryPool.InstanceID="wrong"'
Is "pool_to_sys()" really being run on a GetInstance call?
Wow - that was a spectacularly poor message on my part. I guess the end of the year holiday got the better of me. =) Is the patch alright otherwise? I can resend with an accurate message. -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com
participants (2)
-
Dan Smith
-
Kaitlin Rupert