From dima@tejblum.dnttm.rssi.ru  Mon Mar 24 01:48:28 1997
Received: from helios.dnttm.ru (uutejb@dnttm.wave.ras.ru [194.85.104.197])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA09649
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Mar 1997 01:48:20 -0800 (PST)
Received: (from uutejb@localhost)
	by helios.dnttm.ru (8.8.5/8.8.5/IP-2) with UUCP id MAA09845
	for FreeBSD-gnats-submit@freebsd.org; Mon, 24 Mar 1997 12:49:10 +0300
Received: (from dima@localhost)
	by tejblum.dnttm.rssi.ru (8.8.5/8.8.5) id MAA00800;
	Mon, 24 Mar 1997 12:42:44 +0300 (MSK)
Message-Id: <199703240942.MAA00800@tejblum.dnttm.rssi.ru>
Date: Mon, 24 Mar 1997 12:42:44 +0300 (MSK)
From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Reply-To: dima@tejblum.dnttm.rssi.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: find -fstype local  doesn't work in -current
X-Send-Pr-Version: 3.2

>Number:         3076
>Category:       bin
>Synopsis:       find -fstype local  doesn't work 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:   Mon Mar 24 01:50:01 PST 1997
>Closed-Date:    Wed Mar 26 18:37:06 PST 1997
>Last-Modified:  Wed Mar 26 18:37:41 PST 1997
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD tejblum.dnttm.rssi.ru 3.0-CURRENT FreeBSD 3.0-CURRENT #1: Mon Mar
17 00:48:22 MSK 1997 dima@tejblum.dnttm.rssi.ru:/usr/src/sys/compile/DIMA
i386

>Description:

This bug was introduced by the Lite/2 merge. Lite/2 incorrectly 'fixed'
some bug in find -fstype.


>How-To-Repeat:

Before fix applyed:

dima@tejblum|/usr/home/dima>find /proc -fstype local -prune -print
dima@tejblum|/usr/home/dima>

After fix applyed:

dima@tejblum|/usr/home/dima>find /proc -fstype local -prune -print
/proc
dima@tejblum|/usr/home/dima>


>Fix:
	
*** /usr/src/usr.bin/find/function.c	Sat Mar 22 14:41:57 1997
--- function.c	Sat Mar 22 14:41:48 1997
***************
*** 341,347 ****
  	static dev_t curdev;	/* need a guaranteed illegal dev value */
  	static int first = 1;
  	struct statfs sb;
! 	static short val;
  	char *p, save[2];
  
  	/* Only check when we cross mount point. */
--- 341,347 ----
  	static dev_t curdev;	/* need a guaranteed illegal dev value */
  	static int first = 1;
  	struct statfs sb;
! 	static int val_type, val_flags;
  	char *p, save[2];
  
  	/* Only check when we cross mount point. */
***************
*** 380,393 ****
  		 * Further tests may need both of these values, so
  		 * always copy both of them.
  		 */
! 		val = sb.f_flags;
! 		val = sb.f_type;
  	}
  	switch (plan->flags) {
  	case F_MTFLAG:
! 		return (val & plan->mt_data);
  	case F_MTTYPE:
! 		return (val == plan->mt_data);
  	default:
  		abort();
  	}
--- 380,393 ----
  		 * Further tests may need both of these values, so
  		 * always copy both of them.
  		 */
! 		val_flags = sb.f_flags;
! 		val_type = sb.f_type;
  	}
  	switch (plan->flags) {
  	case F_MTFLAG:
! 		return (val_flags & plan->mt_data) != 0;
  	case F_MTTYPE:
! 		return (val_type == plan->mt_data);
  	default:
  		abort();
  	}

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Wed Mar 26 18:37:06 PST 1997 
State-Changed-Why:  
Suggested fix applied in src/usr.bin/find/function.c rev 1.13, Thanks! 
>Unformatted:
