[Libvirt-cim] [PATCH 1 of 3] VSSD: validate client given object path
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Fri Feb 22 04:22:34 UTC 2008
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart <heidieck at linux.vnet.ibm.com>
> # Date 1203507766 -3600
> # Node ID c77500943eae17131c7d0522a99d16b3e2f43489
> # Parent 60e38dd96ca6871856d64056305fc200d718b3a5
> VSSD: validate client given object path
>
> wbemgi 'http://localhost:5988/root/virt:KVM_VirtualSystemSettingData.InstanceID="Xen:kvm1-f8"'
> on a KVM only system is returning an instance, but should not.
>
> wbemgi 'http://localhost:5988/root/virt:Xen_VirtualSystemSettingData.InstanceID="KVM:kvm1-f8"'
> on a KVM only system is seg faulting, but should not ;).
>
> Signed-off-by: Heidi Eckhart <heidieck at linux.vnet.ibm.com>
>
> diff -r 60e38dd96ca6 -r c77500943eae src/Virt_VSSD.c
> -
> -static CMPIStatus enum_vssd(const CMPIObjectPath *reference,
> - const CMPIResult *results,
> - int names_only)
> + NAMESPACE(reference));
> +
> + if (inst == NULL) {
> + cu_statusf(broker, s,
> + CMPI_RC_ERR_FAILED,
> + "Unable to init VirtualSystemSettingData instance");
> + goto out;
> + }
> +
> + if (!instance_from_dom(dom, inst)) {
Probably not worth a resend, but since instance_from_dom() returns an
int, this should be if (!instance_from_dom(dom, inst) != 1) {
> +
> + s = cu_validate_ref(broker, reference, *_inst);
If we encounter an error here, do we need to set a status message?
> +
> + free(name);
> +
> + out:
> + return s;
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list