Date: Tue, 26 Jun 2001 16:20:47 -0700 (PDT) From: Voradesh Yenbut <yenbut@cs.washington.edu> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/28430: mtree does not correctly compare files when one of which have flags set Message-ID: <200106262320.f5QNKli86125@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106262320.f5QNKli86125>