View Issue Details

IDProjectCategoryView StatusLast Update
00005671003.1(2008)/Issue 7System Interfacespublic2019-06-10 08:55
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionmkdtemp
Page Number1292
Line Number42419-42424
Interp Status---
Final Accepted Text
Summary0000567: mkdtemp() needs to say as if by mkdir()
DescriptionThe description of mkdtemp() should say it creates the directory as
if by a call to mkdir(pathname, S_IRWXU), so that requirements
relating to file owner, file group, and timestamps are brought in.

There are also several minor wording problems on this page, and
inconsistencies between the wording for mkdtemp() and mkstemp(),
which the proposed changes attempt to remedy by rewording and
rearranging the text. The additional changes to the DESCRIPTION
section are not intended to change any requirements made by the
standard. However, one of the changes to the RETURN VALUE section
corrects the omission of a requirement for mkstemp() to set errno.
Desired ActionReplace the entire DESCRIPTION section with:

    The mkdtemp() function shall create a directory with a unique
    name derived from template. The application shall ensure that
    the string provided in template is a pathname ending with six
    trailing 'X' characters. The mkdtemp() function shall modify
    the contents of template by replacing each of these 'X' characters
    with a character from the portable filename character set. The
    characters shall be chosen such that the resulting pathname does
    not duplicate the name of an existing file at the time of the call
    to mkdtemp(). The mkdtemp() function shall use the resulting
    pathname to create the new directory as if by a call to:

    mkdir(pathname, S_IRWXU)

    The mkstemp() function shall create a regular file with a unique
    name derived from template and return a file descriptor for the file
    open for reading and writing. The application shall ensure that
    the string provided in template is a pathname ending with six
    trailing 'X' characters. The mkstemp() function shall modify the
    contents of template by replacing each of these 'X' characters with
    a character from the portable filename character set. The characters
    shall be chosen such that the resulting pathname does not duplicate
    the name of an existing file at the time of the call to mkstemp().
    The mkstemp() function shall use the resulting pathname to create
    the file, and obtain a file descriptor for it, as if by a call to:

    open(filename, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR)

    By behaving as if the O_EXCL flag for open() is set, the function
    prevents any possible race condition between testing whether the
    file exists and opening it for use.

At line 42435 change:

    Upon successful completion, the mkdtemp() function shall return a
    pointer to the string containing the directory name if it was created.

to:

    Upon successful completion, the mkdtemp() function shall return
    the value of template.

At line 42439 change:

    Otherwise, it shall return -1 if no suitable file could be created.

to:

    Otherwise, it shall return -1 and shall set errno to indicate the error.
Tagstc2-2008

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2012-05-24 10:36 geoffclare New Issue
2012-05-24 10:36 geoffclare Status New => Under Review
2012-05-24 10:36 geoffclare Assigned To => ajosey
2012-05-24 10:36 geoffclare Name => Geoff Clare
2012-05-24 10:36 geoffclare Organization => The Open Group
2012-05-24 10:36 geoffclare Section => mkdtemp
2012-05-24 10:36 geoffclare Page Number => 1292
2012-05-24 10:36 geoffclare Line Number => 42419-42424
2012-05-24 10:36 geoffclare Interp Status => ---
2012-05-24 16:26 jim_pugsley Status Under Review => Resolved
2012-05-24 16:26 jim_pugsley Resolution Open => Accepted
2012-05-24 16:26 jim_pugsley Desired Action Updated
2012-05-24 16:30 jim_pugsley Tag Attached: tc2-2008
2019-06-10 08:55 agadmin Status Resolved => Closed