Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 1997 12:42:44 +0300 (MSK)
From:      Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/3076: find -fstype local  doesn't work in -current
Message-ID:  <199703240942.MAA00800@tejblum.dnttm.rssi.ru>
Resent-Message-ID: <199703240950.BAA09740@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3076
>Category:       bin
>Synopsis:       find -fstype local  doesn't work in -current
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 01:50:01 PST 1997
>Last-Modified:
>Originator:     Dmitrij Tejblum
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>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();
  	}

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703240942.MAA00800>