From owner-cvs-all@FreeBSD.ORG Tue Mar 30 08:28:03 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5126A16A4CE; Tue, 30 Mar 2004 08:28:03 -0800 (PST) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i2UGRxKG030895; Tue, 30 Mar 2004 11:27:59 -0500 (EST) (envelope-from green@green.homeunix.org) Received: from localhost (green@localhost)i2UGRx9q030892; Tue, 30 Mar 2004 11:27:59 -0500 (EST) (envelope-from green@green.homeunix.org) Message-Id: <200403301627.i2UGRx9q030892@green.homeunix.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Andrey Chernov , Dag-Erling Smorgrav , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG In-Reply-To: Message from Andrey Chernov <20040330155233.GA71146@nagual.pp.ru> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 30 Mar 2004 11:27:58 -0500 Sender: green@green.homeunix.org Subject: Re: cvs commit: src/etc/mtree BSD.local.dist BSD.usr.dist X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 16:28:03 -0000 Andrey Chernov wrote: > On Tue, Mar 30, 2004 at 10:33:13AM -0500, Brian F. Feldman wrote: > The situation is not so easy, it depends on which mtree mode you use (-P > or -L). I'll try to be short. Imagine, say, you have /var/mail linked to > /disk1/mail. To enforce correct permissions on /disk1/mail you need to use > > MTREE_FOLLOWS_SYMLINKS= -L > > in your /etc/make.conf (or set it in the env. etc). At least in the past > some ports try to change /var/mail permission, so it is real life example. > > But, once you use -L, all symlinks in the BSD.*.dist becomes > just directories and mtree will reports mismatch. Okay, now I understand what the situation is that would make this not work well. Why not just warn and ignore it, then? The proper fix would be to resolve, at the end of reading the mtree spec file, any type=link (when -L) and fail if they cannot be dereferenced internally. --- spec.c 19 Nov 2003 15:28:21 -0000 1.21 +++ spec.c 30 Mar 2004 16:27:35 -0000 @@ -147,7 +147,10 @@ errx(1, "filename %s is ill-encoded", p); set(NULL, centry); - if (!root) { + if (ftsoptions & FTS_LOGICAL && centry->type == F_LINK) { + warnx("line %d: symbolic link %s ignored in -L mode", + lineno, centry->name); + } else if (!root) { last = root = centry; root->parent = root; } else if (last->type == F_DIR && !(last->flags & F_DONE)) { -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\