Bug#336560: vim loops forever in readlink on startup when opening symlinked file with two parent directories of the same name

James Vega jamessan at jamessan.com
Fri Nov 18 15:51:32 UTC 2005


On Sun, Nov 13, 2005 at 08:05:13PM +0100, Stefano Zacchiroli wrote:
> On Sat, Nov 05, 2005 at 10:47:49PM -0500, James Vega wrote:
> > Attached is said patch.  I did some more thorough testing this time and
> > it seems to work properly.  Feedback would definitely be appreciated,
> > especially any ideas about what should be done in the empty "error
> > handling" else block.
> 
> I think that in case of any error it is better to stay on the safe side
> and do as if no symlink where found. The attached patch modify yours
> adding a return value to resolvesymlink(), in case of failure the
> original name is used. (Note that the attached patch replaces
> 304_memline.c including yours changes).
> 
> I tested it against the reported bug and it worked properly.

I made one slight change to the patch.  Instead of immediately returning
with a -1, we first check whether errno == EINVAL (found a non-symlink).
This is an expected condition, so we don't return.  Instead we copy tmp
to buf and fall out of the loop naturally.  I tested with both the
original symlink bug and the infinite loop bug.  Both worked fine.  I'll
be committing as soon as I send out this email.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at jamessan.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20051118/b064f2ec/attachment.pgp


More information about the pkg-vim-maintainers mailing list