Opened 8 years ago

Closed 8 years ago

#14566 closed enhancement (fixed)

Optional parameters for Gurobi

Reported by: ncohen Owned by: ncohen
Priority: major Milestone: sage-5.10
Component: linear programming Keywords:
Cc: Merged in: sage-5.10.beta3
Authors: Nathann Cohen Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Optional parameters for Gurobi !


Attachments (1)

trac_14566.patch (9.1 KB) - added by ncohen 8 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by ncohen

  • Status changed from new to needs_review

comment:2 Changed 8 years ago by vbraun

Can you use sage.misc.temporary_file.tmp_filename for temporary files? Hardcoding a file in a publicly-writeable directory is almost always a security hole:

  sage: p.solver_parameter("LogFile", "/tmp/logfile.log")   # optional - Gurobi 

comment:3 Changed 8 years ago by ncohen

Hmmmmm... It's really just a doctest, and nothing is actually written there. I don't even have to put a path that makes sense.


comment:4 Changed 8 years ago by vbraun

If you just want a nonsensical path then use something like /dev/null. The examples should demonstrate best practices, not how to shoot yourself into your foot if you follow them.

comment:5 Changed 8 years ago by ncohen


I am totally free to write something to "/tmp/log" on my own computer, am I ? I often do that ! O_o


comment:6 Changed 8 years ago by vbraun

Thats fine if you do it on your own personal computer, but if you do it on a multiuser system then some sneaky guy might have created a symlink /tmp/log -> /home/ncohen/important_file before you write to it....

comment:7 Changed 8 years ago by ncohen

Oh. I hadn't thought of that O_o

Fixed !


Changed 8 years ago by ncohen

comment:8 Changed 8 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Looks good to me

I noticed that #12973 is languishing, maybe you want to pick that one up? ;-)

comment:9 Changed 8 years ago by ncohen

What the hell is wrong with #12973 ? Looks like I set my name as the author but I was not the one who wrote the original patch. Even though both files have been uploaded by me O_o


comment:10 Changed 8 years ago by ncohen

Looks like I did some modifications to the author's patch, then uploaded a short reviewer's patch. I just set the names right, and checked that it still applies on the current dev version. If you have a couple of minutes to waste, would you be willing to give it a final check ? Looks like this patch would have been forgotten forever if not for you ^^;


comment:11 Changed 8 years ago by vbraun

This ticket conflicts with #12973 (fuzz 2)

comment:12 Changed 8 years ago by ncohen

I rebased #12973 !


comment:13 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.10.beta3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.