Opened 14 months ago

#14352 new bug

stat() accepts filename with trailing slash

Reported by: pulkomandy Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/libroot.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

According to POSIX issue 7 (but not 6), this should be the case only if the last path component is indeed not a file:

[ENOTDIR] A component of the path prefix names an existing file that is neither a directory nor a symbolic link to a directory, or the path 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.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/stat.html

However it seems the current behavior is what is expected in BPath/BEntry? (https://www.haiku-os.org/legacy-docs/bebook/BPath_Overview.html)

Change History (0)

Note: See TracTickets for help on using tickets.