﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
703	<remove> can't remove a dangling symlink	gerard@…	alfs-log@…	"The remove handler uses the 'stat' call to remove files and check if the file
exists in the first place.

The stat call tries to resolve a symlink. lstat call is identical to stat except
it looks at the link itself. From stat(2) man page:

<quote>
stat stats the file pointed to by file_name and fills in buf.

lstat is identical to stat, except in the  case  of  a  symbolic  link,
where the link itself is stat-ed, not the file that it refers to.
</quote>

The patch as it would apply to 1.1.7 (not checked if it applies to CVS):

diff -Naur nALFS-1.1.7.orig/src/handlers/new-remove.c
nALFS-1.1.7/src/handlers/new-remove.c
--- nALFS-1.1.7.orig/src/handlers/new-remove.c  2003-02-28 08:28:51.000000000 -0700
+++ nALFS-1.1.7/src/handlers/new-remove.c       2003-05-24 11:45:11.000000000 -0600
@@ -37,7 +37,7 @@
 {
         struct stat file_stat;

-        if (stat(file, &file_stat)) {
+        if (lstat(file, &file_stat)) {
                if (errno == ENOENT) {
                        Nprint_h_warn(""File %s doesn't exist."", file);
                        return 0;
                                                              370,5-25      Bot"	defect	closed	lowest		nALFS - Back End (XML Handlers)	SVN	normal	fixed		
