delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/12/19/12:27:39

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E01FB3D.E1C12791@phekda.freeserve.co.uk>
Date: Thu, 19 Dec 2002 17:00:45 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Bugs in __solve_symlinks
Reply-To: djgpp-workers AT delorie DOT com

Hello.

I've found some bugs in the function __solve_symlinks:

* It doesn't cope with multiple consecutive slashes. I have a patch for this.

* It doesn't cope with relative paths that use '..' to go above the root
directory. E.g.: c:/tmp/part-symlink/rem_sl is an existing symlink pointing to
a:/loc_reg. Change into c:/tmp/part-symlink, then do:

    ls -l c:../../tmp/part-symlink/rem_sl
    ls -l c:../../../tmp/part-symlink/rem_sl

The first ls command will succeed; the second will fail.

* It doesn't cope with symlinks that point to themselves. For instance:

    ln -s a a

Try to stat the file 'a'. It fails with ELOOP, but it should return
information about the file 'a'.

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019