1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

remove eval for security concerns

This commit is contained in:
catborise 2021-12-06 09:22:02 +03:00
parent f690d1fa60
commit 5c9a5daedc
2 changed files with 9 additions and 9 deletions

View file

@ -793,9 +793,9 @@ def set_vcpu(request, pk):
@superuser_only
def set_vcpu_hotplug(request, pk):
instance = get_instance(request.user, pk)
status = request.POST.get("vcpu_hotplug", "")
status = True if request.POST.get("vcpu_hotplug", "False") == 'True' else False
msg = _("VCPU Hot-plug is enabled=%(status)s") % {"status": status}
instance.proxy.set_vcpu_hotplug(eval(status))
instance.proxy.set_vcpu_hotplug(status)
addlogmsg(request.user.username, instance.compute.name, instance.name, msg)
return redirect(request.META.get("HTTP_REFERER") + "#resize")