Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000147 [1003.1(2008)/Issue 7] System Interfaces Objection Omission 2009-09-07 20:16 2013-04-16 13:06
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Eric Blake
Organization N/A
User Reference ebb.rename
Section rename
Page Number 1781
Line Number 56929
Interp Status ---
Final Accepted Text Note: 0000218
Summary 0000147: rename and trailing slash
Description The standard requires failure if the last component of the new argument to rename resolves to a non-directory but was spelled with a trailing slash (line 56929), but none of the error sections cover this case. In other words, while rename("file","missing/") is required to fail with ENOTDIR (line 57010) (Linux obeys this rule, but Solaris 10 mistakenly succeeds in renaming to the regular file "missing"), there is no indication which failure to expect for rename("file","file/") or rename("file","other/") (both Linux and Solaris 10 fail with ENOTDIR for these two cases).

Furthermore, the standard requires rename("dir","missing/") to fail with ENOTDIR (line 57010), although both Linux and Solaris 10 allow this to succeed. The comparable rename("dir","dir/") and rename("dir","emptydir/") are required to succeed. In this case, it seems inconsistent to allow the success of renaming a directory with a trailing slash to depend on whether the destination already exists.
Desired Action Replace line 57005:

[ENOTDIR] A component of either path prefix is not a directory; or the old argument names a directory and the new argument names a non-directory file; or the old argument contains at least one non-<slash> character and ends with one or more trailing <slash> characters and the last pathname component names an
existing file that is neither a directory nor a symbolic link to a directory; or the new argument names a nonexistant file, contains at least one non-<slash>
character, and ends with one or more trailing <slash> characters.

with:

[ENOTDIR] A component of either path prefix is not a directory; or the old argument names a directory and the new argument names a non-directory file; or the old argument contains at least one non-<slash> character and ends with one or more trailing <slash> characters and the last pathname component names an
existing file that is neither a directory nor a symbolic link to a directory; or the old argument does not name a directory, and the new argument names a nonexistant file, contains at least one non-<slash> character, and ends with one or more trailing <slash> characters; or the new argument names an existing file that is not a directory, contains at least one non-<slash> character, and ends with one or more trailing <slash> characters.
Tags tc1-2008
Attached Files

- Relationships

-  Notes
(0000218)
geoffclare (manager)
2009-09-08 09:29

The proposed wording is not quite right in a few places. I think
the existing text:

    or the new argument names a nonexistant file, contains at least
    one non-<slash> character, and ends with one or more trailing
    <slash> characters.

should become:

    or the old argument names an existing non-directory file and the
    new argument names a nonexistant file, contains at least one
    non-<slash> character, and ends with one or more trailing <slash>
    characters; or the new argument names an existing non-directory
    file, contains at least one non-<slash> character, and ends with
    one or more trailing <slash> characters.

Also, link() has a similar problem. I think the period at the end
of the ENOTDIR error on the link() page should be replaced with:

    , or the path1 argument names an existing non-directory file and
    the path2 argument names a nonexistant file, contains at least one
    non-<slash> character, and ends with one or more trailing <slash>
    characters.

- Issue History
Date Modified Username Field Change
2009-09-07 20:16 eblake New Issue
2009-09-07 20:16 eblake Status New => Under Review
2009-09-07 20:16 eblake Assigned To => ajosey
2009-09-07 20:16 eblake Name => Eric Blake
2009-09-07 20:16 eblake Organization => N/A
2009-09-07 20:16 eblake User Reference => ebb.rename
2009-09-07 20:16 eblake Section => rename
2009-09-07 20:16 eblake Page Number => 1781
2009-09-07 20:16 eblake Line Number => 56929
2009-09-08 09:29 geoffclare Note Added: 0000218
2009-09-24 15:41 msbrown Interp Status => ---
2009-09-24 15:41 msbrown Final Accepted Text => Note: 0000218
2009-09-24 15:41 msbrown Status Under Review => Resolved
2009-09-24 15:41 msbrown Resolution Open => Accepted As Marked
2010-08-27 13:13 ajosey Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker