Module Name:    src
Committed By:   simonb
Date:           Sun Jul 25 08:52:03 UTC 2021

Modified Files:
        src/lib/libc/stdio: mktemp.3
        src/usr.bin/mktemp: mktemp.1

Log Message:
Update to reflect current reality for template characters - the process
ID is not longer used and we replace each "X" with one of 64 values not
26 values.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdio/mktemp.3
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/mktemp/mktemp.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdio/mktemp.3
diff -u src/lib/libc/stdio/mktemp.3:1.30 src/lib/libc/stdio/mktemp.3:1.31
--- src/lib/libc/stdio/mktemp.3:1.30	Thu Jun 19 09:30:33 2014
+++ src/lib/libc/stdio/mktemp.3	Sun Jul 25 08:52:03 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mktemp.3,v 1.30 2014/06/19 09:30:33 wiz Exp $
+.\"	$NetBSD: mktemp.3,v 1.31 2021/07/25 08:52:03 simonb Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)mktemp.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 18, 2014
+.Dd July 25, 2021
 .Dt MKTEMP 3
 .Os
 .Sh NAME
@@ -67,33 +67,26 @@ This file name is unique and suitable fo
 by the application.
 The template may be any file name with some number of
 .So Li X
-.Sc Ns s
-appended
-to it, for example
+characters appended to it, for example
 .Pa /tmp/temp.XXXXXX .
 The trailing
 .So Li X
-.Sc Ns s
-are replaced with the current process number and/or a
-unique letter combination.
-The number of unique file names
+characters in the template are replaced with a unique letter and number
+combination.
 .Fn mktemp
 can return depends on the number of
 .So Li X
-.Sc Ns s
-provided.
+characters provided.
 Although the
 .Nx
 implementation of the functions will accept any number of trailing
 .So Li X
-.Sc Ns s ,
-for portability reasons one should use only six.
+characters, for portability reasons one should use only six.
 Using six
 .So Li X
-.Sc Ns s
-will result in
+characters will result in
 .Fn mktemp
-testing roughly 26 ** 6 (308915776) combinations.
+testing roughly 62 ** 6 (56800235584) combinations.
 .Pp
 The
 .Fn mkstemp

Index: src/usr.bin/mktemp/mktemp.1
diff -u src/usr.bin/mktemp/mktemp.1:1.23 src/usr.bin/mktemp/mktemp.1:1.24
--- src/usr.bin/mktemp/mktemp.1:1.23	Mon Jul  3 21:34:20 2017
+++ src/usr.bin/mktemp/mktemp.1	Sun Jul 25 08:52:03 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: mktemp.1,v 1.23 2017/07/03 21:34:20 wiz Exp $
+.\" $NetBSD: mktemp.1,v 1.24 2021/07/25 08:52:03 simonb Exp $
 .\" From: $FreeBSD: src/usr.bin/mktemp/mktemp.1,v 1.5 1999/08/28 01:04:13 peter Exp $
 .\" From: $OpenBSD: mktemp.1,v 1.8 1998/03/19 06:13:37 millert Exp $
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD: src/usr.bin/mktemp/mktemp.1,v 1.5 1999/08/28 01:04:13 peter Exp $
 .\"
-.Dd November 4, 2012
+.Dd July 25, 2021
 .Dt MKTEMP 1
 .Os
 .Sh NAME
@@ -61,8 +61,8 @@ characters, such as
 .Pa /tmp/prefix.XXXX .
 The trailing
 .Ql X
-characters in the template are replaced by unique values derived from
-the current process number and additional letters or numbers.
+characters in the template are replaced with a unique letter and number
+combination.
 Any
 .Ql X
 characters other than at the end of the template are taken literally.
@@ -74,7 +74,7 @@ in the template; six
 .Ql X Ns s
 will result in
 .Nm
-testing roughly 26 ** 6 combinations.
+testing roughly 62 ** 6 (56800235584) combinations.
 .Pp
 The templates used to create the unique names are derived from the
 .Fl t Ar prefix

Reply via email to