From 422128b46d9b5820e46fd30b02de65623373935b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 3 Oct 2020 11:51:49 +0200 Subject: [PATCH] man: use paragraphs in descriptions of /tmp and /var/tmp We have three somewhat separate ideas: what the directory is for, what $TMPDIR is for, and security considerations. Let's use paragraphs. Also, conjunctions in titles aren't capitalized usually. --- docs/TEMPORARY_DIRECTORIES.md | 4 +-- man/file-hierarchy.xml | 53 +++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/docs/TEMPORARY_DIRECTORIES.md b/docs/TEMPORARY_DIRECTORIES.md index 5bb24fa3ee..c0f945c885 100644 --- a/docs/TEMPORARY_DIRECTORIES.md +++ b/docs/TEMPORARY_DIRECTORIES.md @@ -1,10 +1,10 @@ --- -title: Using /tmp/ And /var/tmp/ Safely +title: Using /tmp/ and /var/tmp/ Safely category: Interfaces layout: default --- -# Using `/tmp/` And `/var/tmp/` Safely +# Using `/tmp/` and `/var/tmp/` Safely `/tmp/` and `/var/tmp/` are two world-writable directories Linux systems provide for temporary files. The former is typically on `tmpfs` and thus diff --git a/man/file-hierarchy.xml b/man/file-hierarchy.xml index 48114394c4..2c80c2c1a9 100644 --- a/man/file-hierarchy.xml +++ b/man/file-hierarchy.xml @@ -127,20 +127,23 @@ /tmp/ The place for small temporary files. This directory is usually mounted as a tmpfs instance, and should hence not be used for larger files. (Use - /var/tmp/ for larger files.) Since the directory is accessible to other users of - the system, it is essential that this directory is only written to with the mkstemp3, - mkdtemp3 and - related calls. This directory is usually flushed at boot-up. Also, files that are not accessed within - a certain time are usually automatically deleted. If applications find the environment variable - $TMPDIR set, they should prefer using the directory specified in it over directly - referencing /tmp/ (see /var/tmp/ for larger files.) This directory is usually flushed at boot-up. Also, + files that are not accessed within a certain time may be automatically deleted. + + If applications find the environment variable $TMPDIR set, they should use + the directory specified in it instead of /tmp/ (see environ7 and IEEE - Std 1003.1 for details). For further details about this directory, see Using /tmp/ And /var/tmp/ - Safely. + Std 1003.1 for details). + + Since /tmp/ is accessible to other users of the system, it is essential + that files and subdirectories under this directory are only created with mkstemp3, + mkdtemp3, + and similar calls. For more details, see Using + /tmp/ and /var/tmp/ Safely. + @@ -334,20 +337,22 @@ /var/tmp/ The place for larger and persistent temporary files. In contrast to /tmp/, this directory is usually mounted from a persistent physical file system - and can thus accept larger files. (Use /tmp/ for smaller files.) This directory - is generally not flushed at boot-up, but time-based cleanup of files that have not been accessed for - a certain time is applied. The same security restrictions as with /tmp/ apply, - and hence only /tmp/ for small ephemeral files.) This + directory is generally not flushed at boot-up, but time-based cleanup of files that have not been + accessed for a certain time is applied. + + If applications find the environment variable $TMPDIR set, they should use + the directory specified in it instead of /var/tmp/ (see environ7 for + details). + + The same security restrictions as with /tmp/ apply: mkstemp3, mkdtemp3 or - similar calls should be used to make use of this directory. If applications find the environment - variable $TMPDIR set, they should prefer using the directory specified in it over - directly referencing /var/tmp/ (see environ7 for - details). For further details about this directory, see Using /tmp/ And /var/tmp/ - Safely. + project='man-pages'>mkdtemp3, + and similar calls should be used. For further details about this directory, see Using /tmp/ and /var/tmp/ Safely. +