bugSTUMP - Bugs: bug #59263, Safer creation of temp files

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59263: Safer creation of temp files

Submitter:  Tristan Miller <psychonaut>
Submitted:  Tue 13 Oct 2020 01:15:24 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  psychonaut
Open/Closed:  Open Planned Release:  None

Fri 16 Oct 2020 09:24:44 AM UTC, comment #1: 

Possibly a workaround like this would be suitable:


tmpfile=$(
  echo 'mkstemp(template)' |
    m4 -D template="${TMPDIR:-/tmp}/baseXXXXXX"
) || exit


Tristan Miller <psychonaut>
Group administrator
Tue 13 Oct 2020 01:15:24 PM UTC, original submission:  

The scripts do ad-hoc creation of temp files using constructs like TEMPFILE=$TMP/posting.$$.  Pretty much every modern system provides a much safer mktemp command for this purpose, though this hasn't been standardized in POSIX, and the syntax and semantics of the various implementations differ.  However, perhaps the implementations of the platforms we want to target have enough commonality that we can call mktemp anyway?

Tristan Miller <psychonaut>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psychonaut (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code