Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2004 11:27:58 -0500
From:      "Brian F. Feldman" <green@FreeBSD.ORG>
To:        Andrey Chernov <ache@nagual.pp.ru>, Dag-Erling Smorgrav <des@FreeBSD.ORG>, src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/etc/mtree BSD.local.dist BSD.usr.dist 
Message-ID:  <200403301627.i2UGRx9q030892@green.homeunix.org>
In-Reply-To: Message from Andrey Chernov <ache@nagual.pp.ru>  <20040330155233.GA71146@nagual.pp.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
Andrey Chernov <ache@nagual.pp.ru> 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.                       \,,,,,,,,,,,,,,,,,,,,,,\




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