Change in vdsm[master]: virt: Only filter guest agent data, only on XMLRPC

vfeenstr at redhat.com vfeenstr at redhat.com
Mon May 11 11:58:16 UTC 2015


Vinzenz Feenstra has posted comments on this change.

Change subject: virt: Only filter guest agent data, only on XMLRPC
......................................................................


Patch Set 6:

(3 comments)

https://gerrit.ovirt.org/#/c/36949/6/vdsm/virt/guestagent.py
File vdsm/virt/guestagent.py:

Line 334: 
Line 335:     def getStatus(self):
Line 336:         return self.guestStatus
Line 337: 
Line 338:     def getGuestInfo(self, viaXMLRPC=False):
> I'd rename it...propagate "filter" or something like that instead
Done
Line 339:         def filter(o):
Line 340:             if viaXMLRPC:
Line 341:                 return _filterObject(o)
Line 342:             return o


Line 465: 
Line 466:         return result
Line 467: 
Line 468:     @staticmethod
Line 469:     def _parseLine(line):
> no, not really, just noticed it and applied it. I can move it to a separate
Done
Line 470:         # Deal with any bad UTF8 encoding from the (untrusted) guest,
Line 471:         # by replacing them with the Unicode replacement character
Line 472:         uniline = line.decode('utf8', 'replace')
Line 473:         args = json.loads(uniline)


Line 474:         # Filter out any characters in the untrusted guest response
Line 475:         # that aren't permitted in XML.  This must be done _after_ the
Line 476:         # JSON decoding, since otherwise JSON's \u escape decoding
Line 477:         # could be used to generate the bad characters
Line 478:         args = _filterObject(args)
> so this should go away
Done
Line 479:         name = args['__name__']
Line 480:         del args['__name__']


-- 
To view, visit https://gerrit.ovirt.org/36949
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia9ee2a8f1cc6784c619ce68da3cb9342b0d72cfc
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list