A NOTE has been added to this issue. ====================================================================== https://www.austingroupbugs.net/view.php?id=1616 ====================================================================== Reported By: illiliti Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1616 Category: Shell and Utilities Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: Mark Lundblad Organization: User Reference: Section: Shell and Utilities Page Number: - Line Number: - Final Accepted Text: ====================================================================== Date Submitted: 2022-11-08 23:03 UTC Last Modified: 2025-03-07 20:41 UTC ====================================================================== Summary: Standardize mktemp utility ======================================================================
---------------------------------------------------------------------- (0007100) dwheeler (reporter) - 2025-03-07 20:41 https://www.austingroupbugs.net/view.php?id=1616#c7100 ---------------------------------------------------------------------- A few notes: First, I support including this utility, including the "-q" option!! Making it easy to *correctly* create a temporary file is a good thing. The -q option is widely used and supported, so it should be included. This utility can counter a particular kind of attack (where the attacker pre-creates a temporary file, and the program "creates" a file but didn't really create it), and makes it easier to "do the right thing". Making it easier to do the secure thing is an *improvement*. Second, I fear that readers won't realize that this *always* creates a new file or directory, because sometimes the term "create" is informally used to mean "create if it doesn't already exist". I suggest modifying the description "The mktemp utility shall create a temporary regular file or directory..." by adding the word "new" before the word "temporary". By adding one word, it's obvious this is a NEW file or directory. You could argue that this is already true, but I think adding one 3-letter word for clarity is worth it. Third, PLEASE change example 1 from rm "$file" to rm -- "$file" ; the addition of -- is ALWAYS allowed under POSIX. Since we know some existing implementations return relative filenames, even if they're not compliant, it would avoid a problem. Also, people often copy examples and then make changes; changing the template to something else that might begin with "-" would invalidate the argument in a way not obvious to skimming readers. Fourth, example 2 has an extraneous </tt> formatting item at its end. That won't execute well :-). Fifth, under application usage, add: "Note that some historical implementations reply with a relative pathname, not an absolute pathname." That way, people are warned about the old behavior. Sixth, it's too bad that a more general templating mechanism isn't widely supported. I suggest adding a FUTURE DIRECTIONS section to encourage it in the future, like this: FUTURE DIRECTIONS Future versions may allow a sequence of at least trailing <tt>'X'</tt> characters anywhere in the template, where the last such sequence is replaced. Issue History Date Modified Username Field Change ====================================================================== 2022-11-08 23:03 illiliti New Issue 2022-11-08 23:03 illiliti Name => Mark Lundblad 2022-11-08 23:03 illiliti Section => Shell and Utilities 2022-11-08 23:03 illiliti Page Number => - 2022-11-08 23:03 illiliti Line Number => - 2022-11-08 23:30 steffen Note Added: 0006038 2022-11-09 13:18 illiliti Note Added: 0006041 2023-02-22 13:30 ormaaj Note Added: 0006166 2023-02-22 19:10 ormaaj Note Edited: 0006166 2025-02-28 18:37 eblake Note Added: 0007089 2025-03-06 11:09 geoffclare Note Added: 0007093 2025-03-06 11:10 geoffclare Note Edited: 0007093 2025-03-06 11:10 geoffclare Note Edited: 0007093 2025-03-06 11:11 geoffclare Note Edited: 0007093 2025-03-06 15:15 eblake Note Edited: 0007093 2025-03-06 15:53 geoffclare Note Edited: 0007093 2025-03-06 17:19 stephane Note Added: 0007095 2025-03-06 18:02 lanodan Note Added: 0007097 2025-03-06 18:04 lanodan Note Edited: 0007097 2025-03-06 18:05 lanodan Note Edited: 0007097 2025-03-07 15:11 eblake Note Added: 0007098 2025-03-07 15:14 eblake Note Added: 0007099 2025-03-07 20:41 dwheeler Note Added: 0007100 ======================================================================
