* Gerd Hoffmann ([email protected]) wrote:
>   Hi,
> 
> > > OK, what about sanitisation - if that text contains random binary what 
> > > happens,
> > > or should we make sure it's sanitised?
> > 
> > As prior art, the QGA  'guest-exec' command will return stdout/stderr
> > of the command in base64 format.  The downside is that it is bloated
> > in size, but it is at least safe wrt JSON encoding.
> 
> In theory the log should just be text, but I've managed to f*ck up
> logging with broken patches in the past, with the result that random
> binary crap landed in the log.
> 
> So sending base64 in the json reply makes sense to me.  Do we have a
> qapi type for that?  Or should I use string?
> 
> > The HMP command could still dump the raw data IMHO, as that's human
> > facing and base64 is horrible for human consumption.
> 
> And probably a hmp implementation /not/ using the qmp command so we
> don't convert text -> base64 -> text ...

Haha yes; if you can run the HMP through an 'isprint()' or similar
that would be good; I guess you want to keep cr/lf's and maybe tabs,
but you probably don't want anything that screw up the terminal?

Dave

> take care,
>   Gerd
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

Reply via email to