[Top][All Lists]

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

[bug #25294] assertion failure on dangling symlink to //

From: Eric Blake
Subject: [bug #25294] assertion failure on dangling symlink to //
Date: Sun, 11 Jan 2009 01:58:56 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080702 Firefox/ Mnenhy/

Follow-up Comment #1, bug #25294 (project findutils):

More info:

The bug first surfaced in commit acb82fe, Nov 30 2008, at the point when Jim
provided a patch to gnulib fts to do fewer stat's when d_type is reliable.

The problem starts when readdir recognizes that it is too expensive to decide
what the type of a broken symlink is (at least on cygwin), and returns
DT_UNKNOWN (defined as 0).  Next, fts calls fts_stat, which fails because the
symlink is broken, but on cygwin, a symlink to "//nowhere" fails with the
nonstandard errno==ENOSHARE rather than the more typical ENOENT, so no lstat
is attempted to see if the file might be a dangling symlink.

So the bug might be in fts.c, line 1540, for not recognizing all cases of bad
symlinks (even ignoring cygwin's nonstandard ENOSHARE, what happens for a
looping symlink that returns ELOOP?).  Would a readlink() be better than
lstat() to determine that a symlink exists but can't be followed?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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