From owner-freebsd-bugs Tue Jun 26 16:30:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0F84437B407 for ; Tue, 26 Jun 2001 16:30:07 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5QNU7j86810; Tue, 26 Jun 2001 16:30:07 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7DE7137B407 for ; Tue, 26 Jun 2001 16:20:47 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5QNKli86125; Tue, 26 Jun 2001 16:20:47 -0700 (PDT) (envelope-from nobody) Message-Id: <200106262320.f5QNKli86125@freefall.freebsd.org> Date: Tue, 26 Jun 2001 16:20:47 -0700 (PDT) From: Voradesh Yenbut To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/28430: mtree does not correctly compare files when one of which have flags set Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 28430 >Category: bin >Synopsis: mtree does not correctly compare files when one of which have flags set >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 26 16:30:06 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Voradesh Yenbut >Release: 4.2BSD >Organization: U of Washington >Environment: FreeBSD orion.cs.washington.edu 4.2-RELEASE FreeBSD 4.2-RELEASE #1: Mon Dec 18 18:35:55 GMT 2000 root@orion.cs.washington.edu:/usr/src/sys/compile/ORION i386 >Description: Mtree does not correctly compare files against their specs if one of the files has flags such as nodump set. The files not having the flags set show errors like the following: za: flags ("nodump" is not "none") za/z: flags ("nodump" is not "none") za/z/a: flags ("nodump" is not "none") >How-To-Repeat: Running the following commands: ------ rm -rf /tmp/test mkdir /tmp/test mkdir /tmp/test/x mkdir /tmp/test/x/y mkdir /tmp/test/x/z touch /tmp/test/x/z/b touch /tmp/test/y chflags nodump /tmp/test/y ln -s /tmp/test/y /tmp/test/x/y/a rm -rf /tmp/test/za mkdir /tmp/test/za mkdir /tmp/test/za/z touch /tmp/test/za/z/a mtree -cnxiK sha1digest -p /tmp/test > spec mtree -xp /tmp/test < spec >Fix: The patch below on spec.c corrects the problem. The patch on create.c is a patch to what looks like another bug. It is unclear what the bug does. --- spec.c 2001/06/26 21:59:06 1.1 +++ spec.c 2001/06/26 22:13:49 @@ -113,6 +113,7 @@ case 's': if (strcmp(p + 1, "set")) break; + bzero(&ginfo, sizeof(ginfo)); set(NULL, &ginfo); continue; case 'u': --- create.c 2001/06/26 21:00:13 1.1 +++ create.c 2001/06/26 21:08:54 @@ -337,7 +337,7 @@ if (FLAGS2IDX(sflags) < MAXFLAGS && ++f[FLAGS2IDX(sflags)] > maxflags) { saveflags = sflags; - maxflags = u[FLAGS2IDX(sflags)]; + maxflags = f[FLAGS2IDX(sflags)]; } } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message