2 .TH tmpdir 1 "6 April 1999" "Local tools"
4 tmpdir \- choose, or check a choice of, temporary directory
15 program creates a secure place for temporary files to be stored, and
16 outputs an assignment to the
18 variable suitable for execution by a shell.
20 Many programs aren't sufficiently careful about how they handle
21 temporary files. For example, if a program which creates files in
23 without making careful checks beforehand, a malicious user who can
24 predict the name that the program will use can create a symbolic link
25 with that name: when run, the program will then overwrite some file
26 using your current privileges. Similarly, many programs create
27 temporary files using generous default permissions, which may well be a
32 program finds a secure place for temporary files, creating one if
33 necessary. The criteria it uses to choose a place are as follows:
35 The temporary directory must be owned by the user, and have mode 700
36 (i.e., readable, writable and searchable only by the owner).
38 The path through the filesystem to the temporary directory must be
39 secure against modifications by other malicious users. See the
41 manual page for a description of how this is done: the two programs work
46 checks to see whether the current value of the
48 environment variable is a secure place for temporary files. If so, it
49 is accepted immediately. Otherwise, it tries to find or create a
52 (on the assumption that this is a fast disk suitable for temporary
54 .BI /tmp/ user \- suffix
57 If that fails, it tries to create a directory in your home directory,
59 .BI ~/tmp\- suffix\fR.
64 gives up: if your home directory's not secure (or full) than a secure
65 temporary directory is the least of your worries.
67 The following options are supported:
69 .BI "\-C, \-\-check " dir
70 Don't try to find a temporary directory; just see whether
72 is secure, and exit successfully if it is (and unsuccessfully if it
76 Output an assignment using Bourne shell syntax. The default is to
77 examine the user's shell and decide which syntax to use based on that.
80 Output an assignment using C shell syntax.
82 .BI "\-g, \-\-group " group
83 Trust (the members of)
85 consider directories they can write to be safe.
88 Be less verbose; cancel out a
93 Report problems to standard error. Repeat for more verbosity.
102 Mark Wooding (mdw@distorted.org.uk).