This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/20720] New: ntfw with FTW_CHDIR and FTW_DEPTH can't back out of a tree properly giving ENOENT


https://sourceware.org/bugzilla/show_bug.cgi?id=20720

            Bug ID: 20720
           Summary: ntfw with FTW_CHDIR and FTW_DEPTH can't back out of a
                    tree properly giving ENOENT
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: john.ata at baesystems dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 9582
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9582&action=edit
Test case showing nftw failure with relative names climbing out of
subdirectories

When using nftw with glibc, there appears to be a problem when using FTW_CHDIR
with FTW_DEPTH regarding climbing from the descent.  After processing a
directory's contents, it should change working directory back to the parent
before processing the directory since the filename(path+ftwbuf.base) would be
relative to the parent.  Not doing so results in ENOENT being returned when
processing the directory (after contents) while still being in that directory.  

I'm enclosing a testcase.  Output looks:

Processing f2 in working dir /tmp/stest_dir/d1
Processing d1 in working dir /tmp/stest_dir/d1
Oops...relative path does not exist in current directory: No such file or
directory
Processing f1 in working dir /tmp/stest_dir
Processing stest_dir in working dir /tmp/stest_dir
Oops...relative path does not exist in current directory: No such file or
directory

Expected output is:

Processing f2 in working dir /tmp/stest_dir/d1
Processing d1 in working dir /tmp/stest_dir
Processing f1 in working dir /tmp/stest_dir
Processing stest_dir in working dir /tmp

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]