Opened 9 years ago
Closed 9 years ago
#12487 closed defect (fixed)
sdist in /tmp/sage-sdist-$$/sage-VERSION
Reported by: | jdemeyer | Owned by: | leif |
---|---|---|---|
Priority: | major | Milestone: | sage-5.0 |
Component: | scripts | Keywords: | |
Cc: | Merged in: | sage-5.0.beta6 | |
Authors: | Jeroen Demeyer | Reviewers: | Volker Braun |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Currently, sage-sdist
uses
/tmp/sage-VERSION
as temporary directory, leading to all sorts of race conditions.
I propose to use instead
/tmp/sage-sdist-$$/sage-VERSION
Attachments (1)
Change History (9)
comment:1 Changed 9 years ago by
- Status changed from new to needs_review
comment:2 Changed 9 years ago by
- Reviewers set to Volker Braun
comment:3 follow-up: ↓ 4 Changed 9 years ago by
I just don't know about the portability of "mktemp"...
comment:4 in reply to: ↑ 3 Changed 9 years ago by
The various options for mktemp are not very portable, but the above command seems to work on linux, Darwin, and OpenSolaris.
comment:5 Changed 9 years ago by
- Status changed from needs_review to needs_work
Well, we need the "-d" option for directory, but that seems to work also.
Changed 9 years ago by
comment:6 Changed 9 years ago by
- Status changed from needs_work to needs_review
Volker, I made the change you suggested. Needs review.
comment:7 Changed 9 years ago by
- Status changed from needs_review to positive_review
Apparently mktemp isn't POSIX (!?!) but then without it you can't securely create temp files (without the temp directory hack). So everybody in his right mind will have a version of mktemp, I'd say.
comment:8 Changed 9 years ago by
- Merged in set to sage-5.0.beta6
- Resolution set to fixed
- Status changed from positive_review to closed
Why not go all the way and use
This would then also be safe on multi-user systems regardless of umask.