From dima@tejblum.dnttm.rssi.ru  Sun Sep 21 03:16:11 1997
Received: from phobos.ras.ru (root@phobos.ras.ru [193.124.148.76])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA24682;
          Sun, 21 Sep 1997 03:16:06 -0700 (PDT)
Received: (from uucp@localhost)
	by phobos.ras.ru (8.8.5/8.8.5) with UUCP id NAA22074;
	Sun, 21 Sep 1997 13:48:48 +0400
Received: (from uucp@localhost)
	by helios.dnttm.ru (8.8.5/8.8.5/IP-3) with UUCP id MAA06646;
	Sun, 21 Sep 1997 12:25:45 +0400
Received: (from dima@localhost)
	by tejblum.dnttm.rssi.ru (8.8.7/8.8.5) id MAA25213;
	Sun, 21 Sep 1997 12:26:38 +0400 (MSD)
Message-Id: <199709210826.MAA25213@tejblum.dnttm.rssi.ru>
Date: Sun, 21 Sep 1997 12:26:38 +0400 (MSD)
From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Reply-To: dima@tejblum.dnttm.rssi.ru
To: FreeBSD-gnats-submit@freebsd.org
Cc: imp@freebsd.org
Subject: FTS broken in -current
X-Send-Pr-Version: 3.2

>Number:         4593
>Category:       bin
>Synopsis:       FTS broken in -current
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 21 03:20:01 PDT 1997
>Closed-Date:    Mon Sep 22 06:03:33 PDT 1997
>Last-Modified:  Mon Sep 22 06:04:04 PDT 1997
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD tejblum.dnttm.rssi.ru 3.0-CURRENT FreeBSD 3.0-CURRENT #40: Sun Sep 14 00:40:00 MSD 1997     dima@tejblum.dnttm.rssi.ru:/usr/src/sys/compile/DIMA  i386

>Description:

The "fix for NetBSD PR#1495" (change in NAPPEND macro), commited to fts.c 
a couple of weeks ago, broked FTS badly. Now using of FTS with FTS_NOCHDIR 
option (in particular, FTS with FTS_LOGICAL option) may lead to an absolutely 
incorrect result.

>How-To-Repeat:

Try to remove a directory with
rm -r directory/
(note '/' at the end)

Look at result of 
find -L directory/ 
(also note '/' at the end)

Look at result of
ls -LR directory/
(again note '/' at the end)

And so on.

>Fix:

--- fts.c.00	Sun Aug 31 13:47:24 1997
+++ fts.c	Tue Sep 16 13:16:48 1997
@@ -745,11 +745,11 @@
 	/*
 	 * If not changing directories, reset the path back to original
 	 * state.
 	 */
 	if (ISSET(FTS_NOCHDIR)) {
-		if (cp - 1 > sp->fts_path)
+		if (len == cur->fts_pathlen)
 			--cp;
 		*cp = '\0';
 	}
 
 	/*
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Mon Sep 22 06:03:33 PDT 1997 
State-Changed-Why:  
Suggested change applied in rev 1.6 of fts.c 
>Unformatted:
