Bug 261438 - mktemp(1): better unique file names
Summary: mktemp(1): better unique file names
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Wolfram Schneider
URL: https://reviews.freebsd.org/D34014
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-24 18:48 UTC by Wolfram Schneider
Modified: 2022-02-12 11:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schneider freebsd_committer freebsd_triage 2022-01-24 18:48:04 UTC
Our mktemp(1) implementation uses 8-X for a temp file by default. That's ok, but we should increase the value from 8 to 10 as many other OS already did.

git grep '\.XXXXXXXX'
mktemp.c:                       asprintf(&name, "%s%s.XXXXXXXX", _PATH_TMP, prefix);
mktemp.c:                       asprintf(&name, "%s/%s.XXXXXXXX", tmpdir, prefix);
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-02-12 11:40:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=98839c40c74aed19324962c365ebc2cb8520f91e

commit 98839c40c74aed19324962c365ebc2cb8520f91e
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2022-02-12 11:35:51 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2022-02-12 11:35:51 +0000

    better unique file names

    Our mktemp(1) implementation uses 8-X for a temp file by default.
    That's ok, but we should increase the value from 8 to 10 as
    many other OS already did.

    PR:             261438

 usr.bin/mktemp/mktemp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)