WG15 Defect Report Ref: 9945-1-74
Topic: tmpfile


This is an approved interpretation of 9945-1:1990.

.

Last update: 1997-05-20


                                                                9945-1-90 #74

 _____________________________________________________________________________

	Topic:			tmpfile
	Relevant Sections:	8.2.3.9
	Classification:		


Defect Report:
-----------------------

This is a request for interpretation of ISO/IEC 9945-1:1990 (IEEE Std
1003.1-1990)


Section 8.2.3.9 tmpfile(), line 398-399 describes the tmpfile()
function as "tmpfile() shall allocate a file descriptor as fopen() does".

The fopen() descriptions states "The fopen() function shall allocate
a file descriptor as open() does". 

Many common implementations return a file descriptor for an unlinked file.  
Is it conforming for tmpfile() to call open() with a mode of zero, so
that the temporary file created in the file namespace prior to
unlinking be protected from access by other users ?

POSIX 13210 has an assertion  8.2.3.9-05(B) that would say
that it is not conforming; the assertion states:

"When a call to tmpfile() creates a file, then the file permission bits
are set to allow both reading and writing for owner, for group, and
for other users except for those bits set in the process's file mode
creation mask. No execute (search) permission bits are set. The user
ID of the file is set to the process's effective user ID and the group
ID of the file is set to the process's effective group ID or to the
group owner of its parent directory."


This assertion relates to the references between tmpfile() -> fopen() -> open().
It appears to us that this requirement is beyond the specification in
9945-1 for tmpfile() which is to allocate a file descriptor and that this
requirement in 13210 should be noted as incorrect.



WG15 response for 9945-1:1990 (9945-1-90 #74)
-----------------------------------
Yes it is conforming.  The standard clearly does not require a
particular implementation of tmpfile(), just that 
a file descriptor be allocated.

This is a conflict between the 9945-1 base standard and the 13210
test method standard.  The test method standard clearly indicates that a 
conforming test suite is required to test this, however the base
standard indicates that a conforming implementation may fail such a test.
This situation is being referred to the sponsor(s).

Rationale for Interpretation:
-----------------------------
None.
Forwarded to Interpretation group: Aug 30 1995
Resolution forwarded for review: Oct 18 1995
Finalised: Nov 21 1995