#15515: Change graphics_filename() to return a tmp_filename() except from the
notebook
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.3
      Component:  misc               |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/gagern/ticket/15515              |  b3e656b4507d9f6544e87641614836dc6275e929
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by gagern):

 * status:  needs_work => needs_review
 * commit:  43137d0eb054bc5e7a46659e5693fcc1376455b9 =>
     b3e656b4507d9f6544e87641614836dc6275e929
 * work_issues:  rebase =>
 * branch:  u/jdemeyer/ticket/15515 => u/gagern/ticket/15515


Comment:

 Rebased this. Funny, I was coding something along the same lines at the
 moment, before comment:34:ticket:16533 made me aware of this ticket here.

 [http://git.sagemath.org/sage.git/log/?h=u/gagern/feature
 /graphics_filename-passthrough My own modifications] (which I have just
 modified to build on this here) also move some other tasks into that
 function, namely passing a caller-provided filename back (either unaltered
 or with added suffix) unless it is `None`. That way, one can simply do
 `graphics_filename(filename=filename)` without worrying whether the user
 specified a file name or not.

 But since I might end up reviewing your commit, I probably should file my
 own as a separate ticket… I haven't looked at ''all'' your modifications
 yet, but I notice that
 
[http://git.sagemath.org/sage.git/tree/src/sage/plot/plot3d/base.pyx?id=6.3.beta1#n1131
 code in plot3d/base.pyx] is still pretty broken with regard to
 `graphics_filename`: they call it to generate some name, then strip the
 original extension and add an assortment of other extensions. That's just
 asking for a name clash. And if `SAGE_TMP` would happen to be world
 writable (although I can't imagine how that might be), then a security
 relevant race condition would be very likely.

 If I were to fix this, I would be using my own code for this. Jeroen,
 could we review one another's code for this?

 I guess I'd also like to use this function (with my own additions) all
 over the place for animations. Doing that would fix #16608 as well, would
 be a useful basis for my next stab at #16533, and would make
 
[http://git.sagemath.org/sage.git/commit/?id=005b83f2379d786b88f9a6b194dd334c038ea8ca
 005b83f] from #16571 superfluous as well.
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=b3e656b4507d9f6544e87641614836dc6275e929
 b3e656b]||{{{graphics_filename: return a tmp_filename() if not in
 EMBEDDED_MODE}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/15515#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to