Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#309 closed defect (invalid)

stat() for '\..' should fail

Reported by: KO Myung-Hun Owned by:
Priority: normal Milestone: libc-0.7
Component: libc Version: 0.6.5
Severity: normal Keywords:



stat() for '\..' should fail. A parent of root is invalid.

Attachments (1)

parent-of-root-is-invalid.diff (651 bytes) - added by KO Myung-Hun 6 years ago.
patch for '\..'

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by KO Myung-Hun

patch for '\..'

comment:1 Changed 6 years ago by bird

Resolution: invalid
Status: newclosed

No, the parent of root is root, on FreeBSD, Linux, Windows and most importantly OS/2. Play around with stat /../../.. if you don't believe me.

comment:2 Changed 6 years ago by KO Myung-Hun

Resolution: invalid
Status: closedreopened

I've confirmed. But VAC 3.08, OpenWatcom? v1.8 and EMX return an error. kLIBC should considers the compatiblity with other OSes more importantly than other OS/2 compilers ?

comment:3 Changed 6 years ago by bird

Resolution: invalid
Status: reopenedclosed

Yes, POSIX/UNIX compatibility is much more important than being compatible with IBM VisualAge? for C++, [Open]Watcom C/C++ or Microsoft C. Again just try call stat("/../../..", &St); on FreeBSD.

As mentioned in the wiki and numerous bugs, kLibC is NOT aiming at being bug compatible with either of the compilers you mentioned, but rather making porting UNIX open source code easier. This means leaning towards API behavior described by OpenGroup? / POSIX and actual UNIX implementations or clones, rather than some obscure and mostly discontinued compilers.

(Seems the Dos* APIs on OS/2 are unable to resolve "C:\..", despite the root directory having a '..' entry. I recall there being a HPFS or HPFS386 (or was it JFS?) APAR adding it to the root directory a very long time ago, too bad they didn't make it do what it is supposed to do.)

comment:4 Changed 6 years ago by KO Myung-Hun

I already confirmed on MingW and Linux. stat() worked on those OSes as you said. But OS/2 compilers did differently. So I asked.

I certainly came to know the aiming point of kLIBC. And I absolutely agree with you. Thanks.

Note: See TracTickets for help on using tickets.