Repository navigation
Conversation
4a68c76 to
1b6bec2
Compare
1b6bec2 to
e5b4a28
Compare
|
|
||
| //==============Save pad/canvas as a HTML============================== | ||
| if (gtype == TImage::kHtml) { | ||
| auto cmd = TString::Format("TWebCanvas::ProduceImage((TPad *) 0x%zx, \"%s\");", (size_t) this, psname.Data()); |
There was a problem hiding this comment.
We should find a different way to do this. What if psname is a maliciously-crafted string like "\"); gSystem->Exec(\"rm -rf $HOME\");" ?
There was a problem hiding this comment.
Yes, one can create small plugin for this. I need to think
There was a problem hiding this comment.
I propose to use regex here to exclude all special symbols - before writing any special plugin.
There was a problem hiding this comment.
@dpiparo thoughs about this? I'm personally always skeptical about this kind of sanitization...
There was a problem hiding this comment.
This kind of sanitization was discussed in the past. I think the conclusion is that it could seem that it guarantees security, while, on the other hand, it's hard to guarantee it does.
There was a problem hiding this comment.
I did not change code which was existing - just moved it and add regex to filter-out "dangerous" symbols.
One can do it better - but this will invoke plugin handler - which potentially has more problems while using much more sophisticated interpreter.
This code will be significantly changed by transition to ROOT7.
Test Results 22 files 22 suites 3d 11h 22m 9s ⏱️ For more details on these failures, see this check. Results for commit 7c64f36. ♻️ This comment has been updated with latest results. |
Finalize changes of SaveAs logic in the pad/canvas - there is now the only place where pad painter SaveAsImage is called for all kinds of painters, no special call for web canvas in the front. Only difference for web - discard border highlight before saving. Therefore there is no need to call Update() for the web canvas.
Now information printed from TPad::Print() method. Old log messages can be enabled with gDebug = 1
e5b4a28 to
7c64f36
Compare
|
I decide to suppress default logging from For HTML file creation I using regex to remove any kind of extra symbols. |
TPad::Print()method used to generate images.It had explicit handling of web canvas with its own log output.
And there was drawback in case when C macro was produced - while TCanvas::Update() also was invoked for web canvas
Now move code in one central place where image generation via pad painter interface is handled.
And use normal
TPad::Printlogging when generate image also for web canvas case.Also remove misleading warning about unsupported C file format in web canvas.