Subject: mkstemp(3)
To: None <>
From: Aymeric Vincent <>
List: tech-userlevel
Date: 06/20/2001 17:48:26

mkstemp(3) creates temporary files with permissions 0600. That's what
the manual page says.

However, a user with a 777 umask (or 600) will get his temp files
created with permissions 000.

Vi (the editor) is having trouble with that as it expects the file to
be read/writable. OpenBSD have ``fixed'' vi to fchmod 0600 the file.

The question for this list is:

- is it acceptable to have mkstemp(3) ensure that the created file is
  0600 (as the manual page claims somehow)?

- otherwise, could we point users to the fact that mkstemp, using
  open(2), is subject to umask(2) behaviour?

As for vi, I intend to fail properly if the temp file is not
read/writable. People with such umask's wouldn't want to run vi. ;-)