Mktemp is not in the book

Alexander E. Patrakov semzx at
Thu Jan 30 20:42:29 PST 2003

On Thursday 30 January 2003 17:19, Bill's LFS Login wrote:

> Not ironic at all. Mktemp is a deprecated command, IIRC, for security
> reasons because of the potential race/predictability-of-names issue.
> Looks like we either:
> a) accept a security risk,
> b) continue to have some LFS installed stuff that doesn't work,
> c) patch a version of tempfile and mktemp ourselves to use mkstemp
> d) continue scrounging to find a good version of both tempfile and/or
>    mktemp
The problem does not exist.

You need to install mktemp-1.4 in the following way:

Contents of Mktemp:

Last checked against version 1.4

The mktemp program is used by various shell scripts when they need to create a 
temporary file with unique name. TODO: tempfile wrapper script.

Mktemp installation dependencies:

Last checked against 1.4

Bash: sh
Binutils: as, ld, nm
Fileutils: chmod, cp, install, ln, mv, rm
Gcc: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr

(all shamelessly copied from gzip, not sure of tr, TODO: please recheck)

Installation of Mktemp:

Prepare Mktemp to be compiled:

./configure --prefix=/usr --with-libc

The meaning of the --with-libc configure option is to force the mktemp program 
to use secure mk{s,d}temp routines from glibc. Verify that it really intends 
to do so by looking for

checking whether to use mk{s,d}temp from libc... (cached) yes

in the ./configure output.

Continue with compiling package:


and installing it:

make install

TODO: invent the wrapper script that will be called tempfile. Can't do that 
right now since I don't know thh command line options for tempfile.

Alexander E. Patrakov
Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list