version 1.7, 1998/03/07 22:18:16 |
version 1.8, 1998/03/19 06:13:37 |
|
|
.Fl u |
.Fl u |
flag is given) and the filename is printed |
flag is given) and the filename is printed |
to standard output. |
to standard output. |
|
.Pp |
|
.Nm Mktemp |
|
is provided to allow shell scripts to safely use temporary files. |
|
Traditionally, many shell scripts take the name of the program with |
|
the pid as a suffix and use that as a temporary file name. This |
|
kind of naming scheme is predictable and the race condition it creates |
|
is easy for an attacker to win. A safer, though still inferior, approach |
|
is to make a temporary directory using the same naming scheme. While |
|
this does allow one to guarantee that a temporary file will not be |
|
subverted, it still allows a simple denial of service attack. For these |
|
reasons it is suggested that |
|
.Nm |
|
be used instead. |
.Sh OPTIONS |
.Sh OPTIONS |
.Bl -tag -width indent |
.Bl -tag -width indent |
The available options are as follows: |
The available options are as follows: |
|
|
the check to be done later one in the script (since |
the check to be done later one in the script (since |
$? would get clobbered by the next shell command). |
$? would get clobbered by the next shell command). |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr mkstemp 3 , |
.Xr mktemp 3 , |
.Xr mktemp 3 |
.Xr mkdtemp 3 , |
|
.Xr mkstemp 3 |
.Sh HISTORY |
.Sh HISTORY |
The |
The |
.Nm |
.Nm |