From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 11 02:24:34 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86B18106566C for ; Mon, 11 Oct 2010 02:24:34 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 43A8C8FC0C for ; Mon, 11 Oct 2010 02:24:33 +0000 (UTC) Received: by iwn8 with SMTP id 8so3965890iwn.13 for ; Sun, 10 Oct 2010 19:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=QEL+T7bfKig+HtbiK3UuShBEyr3nI5N1Xxcjco7RQsI=; b=e2eyzkRsVc40ra0TYmBZuKBshkVEW358t0GjF7GyVqOj0OCQBPTWmxbFmSimaOvfi8 3Skx5e6etxEtK7NCtwNF9O94kcGQa2q44MWL7ZX1HC+LWyvxDUVgMVwkUqeD1Rt7pkNY 8ianWQWK6wVNo/Bqq8nKRc5IEkXc5W55tIuac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=qSzJ0ZhyGwgsK+ZPmO7yErsNa7nxlHxeqYatUduzH86NGyfYxCjfG1mrt4ZKxzP2yC ORsUmfYdriLIW66OBusw2CgkfY+27+TCdB9wGvKri5nju4HaDxn/6vT+CLu4KUABPryH arJq581tLlo4IB+tWsjMznijiObMLlyFHP6Qg= MIME-Version: 1.0 Received: by 10.231.14.72 with SMTP id f8mr4200458iba.171.1286762482273; Sun, 10 Oct 2010 19:01:22 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.184.3 with HTTP; Sun, 10 Oct 2010 19:01:22 -0700 (PDT) In-Reply-To: References: <201003300830.o2U8U93Y096013@freefall.freebsd.org> <20100331034500.O1425@besplex.bde.org> <20100331060503.G1425@besplex.bde.org> <364299f41003301740m4ca73398v9aadcc87e53a4628@mail.gmail.com> Date: Sun, 10 Oct 2010 19:01:22 -0700 X-Google-Sender-Auth: uJJxYoK9NVrCacZWJGaoOW4iCCU Message-ID: From: Garrett Cooper To: Garrett Cooper Content-Type: multipart/mixed; boundary=00221532cc9caa8ea704924dbcae Cc: freebsd-bugs@freebsd.org, Bruce Evans Subject: Re: bin/144411: [patch] mtree(8) doesn't reject non-regular files for -X X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 02:24:34 -0000 --00221532cc9caa8ea704924dbcae Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Aug 29, 2010 at 3:55 AM, Garrett Cooper wrote= : > On Sun, Aug 29, 2010 at 3:54 AM, Garrett Cooper wro= te: >> On Tue, Mar 30, 2010 at 5:40 PM, Garrett Cooper wr= ote: >>> On Tue, Mar 30, 2010 at 12:12 PM, Bruce Evans wr= ote: >>>> On Wed, 31 Mar 2010, Bruce Evans wrote: >>>> >>>>> On Tue, 30 Mar 2010, Garrett Cooper wrote: >>>>> >>>>>> Hi, >>>>>> =A0 =A0I'm not 100% satisfied with this patch now. Looking back it f= ails >>>>>> the following case: >>>>>> >>>>>> =A0 =A0 -P =A0 =A0Do not follow symbolic links in the file hierarchy= , instead >>>>>> con- >>>>>> =A0 =A0 =A0 =A0 =A0 sider the symbolic link itself in any comparison= s. =A0This is the >>>>>> =A0 =A0 =A0 =A0 =A0 default. >>>>> >>>>> -P should have the same semantics and description in all utilities. = =A0The >>>>> description should not have grammar errors like the above (comma spli= ce). >>>>> ... >>>>> I now see that the grammar error is from the original version of mtre= e(1), >>>>> and is probably one of the things you don't like. =A0mtree also has -= L, but >>>>> not -R or -P or -h. =A0It is not clear how any utility that traverses= trees >>>>> can work without a full complement of -[HLPR] or how any utility that >>>>> ... >>>> >>>> Looking at the actual patch, I now see that it is about a completely >>>> different problem. =A0You would only need to understand the amount of >>>> brokenness of -P to see if you need to use lstat(). =A0I think -P is s= o >>>> broken that mtree on symlinks doesn't work at all and not using lstat(= ) >>>> would be safest. >>> >>> Hmmm... so I take it that this is actually the first step in many to >>> fixing this underlying problem? I suppose I should be opening bugs for >>> all of the itemized issues that you see in mtree(8) so someone can >>> submit patches to fix the utility? >>> >>>> The patch has some style bugs. >>> >>> Please expound on this -- I want to improve my style (without having >>> to rewrite the entire program of course) -- so that it conforms more >>> to the projects overall style rules; of course there are some cases >>> where I can't readily do that (like pkg_install -- ugh), but I'll do >>> my best to make sure that the rules are withheld. >> >> =A0 =A0Just for the record, here's the latest patch that I submitted to >> Bruce for this PR. > > Dog gone it; attached the wrong patch. This is the right patch.. I've been sitting on this PR for a while and I'd like to wrap it up and move on, if that's ok. Here's a patch with a more suitable comment above the stat(2) call. Thanks! -Garrett --00221532cc9caa8ea704924dbcae Content-Type: text/plain; charset=US-ASCII; name="bin.144411.diff.txt" Content-Disposition: attachment; filename="bin.144411.diff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gf4p3ge01 SW5kZXg6IHVzci5zYmluL210cmVlL2V4Y2x1ZGVzLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLnNiaW4v bXRyZWUvZXhjbHVkZXMuYwkocmV2aXNpb24gMjEzNjY3KQorKysgdXNyLnNiaW4vbXRyZWUvZXhj bHVkZXMuYwkod29ya2luZyBjb3B5KQpAQCAtMzAsOSArMzAsMTAgQEAKICNpbmNsdWRlIDxzeXMv Y2RlZnMuaD4KIF9fRkJTR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