|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1625 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1625.
Report 1625 Actions
Problem Report Number 1625 Submitter's Classification Specification problem State Resolved Resolution Permanent Interpretation (PIN) Problem Resolution ID PIN.X.0182 Raised 1997-10-29 08:00 Updated 2003-03-13 08:00 Published 1997-11-05 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.1 Test Identification CAPI.os/genuts/nftw 3 Specification System Interfaces and Libraries Issue 4 Version 2 Location in Spec See Problem Text Problem Summary PIN4U.00048 This test may fail on implementations that exhibit behavior allowed by Base Resolution 97-003. Problem Text
Based on a Base Working Group resolution request we initiated we
ask for a waiver for this test. The details of the resolved resolution
can be found at:-
http://www.rdg.opengroup.org/mem_only/tech/base/resns/eastwood/bwg97-003.html
For ease we list the resolution here:-
97 #003
____________________________________________________________________________
_
Topic: nftw
Relevant Sections: nftw
Spec: XSH Issue 4 Version 2 & Issue 5
Resolution Request:
-------------------
The test for nftw fails as follows:
TEST PURPOSE #3
A call to int nftw(const char *path, int (*fn)(const
char *, const struct stat *, int, struct FTW *), int
depth, int flags) when flags does not contain FTW_PHYS
shall follow links instead of reporting them and shall
not report the same file twice.
PREP: Set up the path
TEST: nftw without FTW_PHYS follows symbolic links
INFO: Call to fn() at ../tmp/data/dirl
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1/dir_left.2
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1/dir_left.2/left.3
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1/dir_right.2
INFO: Call to fn() at
../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1/dir_right.2/right.3
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1/dir_right.2
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1/dir_right.2/right.3
ERROR: Target of right.3 was already reported so this file should not be
3 FAIL
On looking at this result we see that the test does test what the specification
says and we feel that there is a specification error here. The previous test
tests what is established historical practice and is what the SVID III defines
as the functionality in this area. It appears that when the SVID was included
to create the XPG4.2 specifications a rewrite of some of the words has changed
the meaning in a detrimental way.
The FTW_PHYS wording from the SVID, on which the nftw() entry is
based says "Physical walk, does not follow symbolic links. Otherwise,
nftw() will follow links but will not walk down any path that crosses
itself." Somehow, the XSH4.2 wording became "... If clear, nftw()
will follow links instead of reporting them, and will not report the
same file twice."
The existing practice is to keep information about *directories*.
If one is about to start walking through the directory entries for
a directory with the same device/inode pair for one we've got "on
the stack", we instead immediately close the directory and skip it.
That's all. This requires, for a recursive nftw() implementation,
exactly one item on the stack/directory-call.
To perform to the letter of the XSH4.2 words, the implementation
must record the device/inode pair for *every file* reported during
the entire call and for each new entry, check to see if it has the
same pair! This forces an additional O(n) in space and at least
O(n log n) time for "n" files reported. It doesn't even help if
the description is taken to mean that only files reached for a
second or subsequent time through only *symbolic* links are to be
checked for, since we still need to keep the device/inode pairs
for all the regular files in case a symbolic link comes later.
We believe this is an incorrect technical editorial modification to the
nftw() functionality which in XPG4.2 was to standardise on existing
practice as identified by the SVID.
This is referred to the Base WG to query if the change from
historical behaviour was the intent.
Resolution Response
-------------------
A future revision will replace the FTW_PHYS clause of nftw()
with the following text. For existing conforming either behaviour is
allowed.
FTW_PHYS If set, nftw() performs a physical walk and does not follow
symbolic links.
If FTW_PHYS is clear and FTW_DEPTH is set,
nftw() will follow links instead of reporting them,
but will not report any directory that would be a descendant
of itself. If FTW_PHYS is clear and FTW_DEPTH is clear, nftw() will follow
links instead of reporting them, but will not report the contents
of any directory that would be a descendant of itself.
Rationale
-------------
This matches historical behaviour.Test Output
TEST PURPOSE #3
A call to int nftw(const char *path, int (*fn)(const
char *, const struct stat *, int, struct FTW *), int
depth, int flags) when flags does not contain FTW_PHYS
shall follow links instead of reporting them and shall
not report the same file twice.
PREP: Set up the path
TEST: nftw without FTW_PHYS follows symbolic links
INFO: Call to fn() at ../tmp/data/dirl
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1/dir_left.2
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_left.1/dir_left.2/left.3
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1
INFO: Call to fn() at ../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1/dir_right.2
INFO: Call to fn() at
../tmp/data/dirl/dir_left.1/dir_left.2/left.3/dir_right.1/dir_right.2/right.3
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1/dir_right.2
INFO: Call to fn() at ../tmp/data/dirl/dir_right.1/dir_right.2/right.3
ERROR: Target of right.3 was already reported so this file should not be
3 FAILReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
A permanent interpretation is recommended.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Permanent Interpretation (PIN) Review Conclusion
A Permanent Interpretation is granted.
Problem Reporting System Options:
- View Report 1625
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority