bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

canonicalize: fix recently reported readlink bug


From: Jim Meyering
Subject: canonicalize: fix recently reported readlink bug
Date: Thu, 27 Sep 2007 11:12:54 +0200

I've just done the following to gnulib:

2007-09-27  Jim Meyering  <address@hidden>

        canonicalize: Avoid a false-positive cycle failure.
        * modules/canonicalize (Depends-on): Add file-set and hash-triple.
        Sort.  Remove cycle-check.
        * lib/canonicalize.c: Include file-set.h and hash-triple.h,
        not cycle-check.h.
        (seen_triple): New function.
        (canonicalize_filename_mode): Use it instead of cycle-check.
        * tests/test-canonicalize.c: Add a test for this bug.
        * tests/test-canonicalize.sh: Set up and run the test.

        New module, file-set.
        * modules/file-set: Define it.
        * lib/file-set.c, lib/file-set.h: Implement.

        New module, hash-triple.
        * modules/hash-triple: Define it.
        * lib/hash-triple.c, lib/hash-triple.h: Implement.

and the following to coreutils:

2007-09-27  Jim Meyering  <address@hidden>

        Move file-set and hash-triple modules to gnulib.
        * bootstrap.conf (gnulib_modules): Remove file-set, now that
        it's in gnulib, and the canonicalize module requires it there.
        * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
        * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set:
        Remove.

        Add a test to exercise a readlink bug.
        * tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
        fixed through today's change to Gnulib's canonicalize module.
        * tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
        Bug report and a test case from address@hidden

For details, see the five change sets here:

    http://git.sv.gnu.org/gitweb/?p=gnulib.git
    http://git.sv.gnu.org/gitweb/?p=coreutils.git

There is only minimal documentation for the two new gnulib modules,
partly because I don't particularly like their names -- especially
file-set and its two exported functions (also used in ln.c and copy.c).
So they might well change.  Suggestions welcome.

Also, if anyone can find a better way to detect cycles in canonicalize.c
or poke holes in this latest change, let us know.  Patches are always welcome.

BTW, I've just realized that canonicalize.c has never detected hard
directory cycles -- the kind that usually indicate file system corruption.
But I'm in no hurry to deal with that.

Jim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]