delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/06/10/08:47:16

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3D048EF2.455CD32B@phekda.freeserve.co.uk>
Date: Mon, 10 Jun 2002 12:35:14 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: FSEXT hooks and symlinks
Reply-To: djgpp-workers AT delorie DOT com

Hello.

I've just been looking at the FSEXT hooks code. I noticed that symlinks are
not handled consistently. Should the symlink be resolved, before calling a
function that takes a path name? For instance compare
src/libc/ansi/stdio/remove.c and src/libc/posix/sys/stat/lstat.c. lstat.c
passes the FSEXT the resolved name. remove.c passes the FSEXT the original
name. I haven't looked at any other cases, but I think the FSEXT docs should
be more clear on what kind of filename an FSEXT can expect to have passed into
it.

Actually, I have another question. How do we remove symlinks using libc?
According to the unlink man page on RedHat Linux 6.2 unlink() should remove a
symlink. But looking at the code for remove (and hence unlink) in our libc, it
looks like it will always remove the target file. I think this is a bug.

Thanks, 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