From owner-freebsd-bugs@FreeBSD.ORG Fri May 7 07:30:08 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A06F91065673 for ; Fri, 7 May 2010 07:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 767538FC08 for ; Fri, 7 May 2010 07:30:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o477U8QM085801 for ; Fri, 7 May 2010 07:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o477U8va085796; Fri, 7 May 2010 07:30:08 GMT (envelope-from gnats) Date: Fri, 7 May 2010 07:30:08 GMT Message-Id: <201005070730.o477U8va085796@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Cooper Cc: 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 Reply-To: Garrett Cooper List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2010 07:30:08 -0000 The following reply was made to PR bin/144411; it has been noted by GNATS. From: Garrett Cooper To: Garrett Cooper Cc: Bruce Evans , bug-followup Subject: Re: bin/144411: [patch] mtree(8) doesn't reject non-regular files for -X Date: Fri, 7 May 2010 00:20:29 -0700 --005045016ba0d819d70485fbe4b3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Mar 30, 2010 at 11:47 PM, Garrett Cooper wrot= e: > On Tue, Mar 30, 2010 at 11:46 PM, Garrett Cooper wr= ote: >> On Tue, Mar 30, 2010 at 11:35 PM, Garrett Cooper w= rote: >>> On Tue, Mar 30, 2010 at 5:40 PM, Garrett Cooper w= rote: >>>> On Tue, Mar 30, 2010 at 12:12 PM, Bruce Evans w= rote: >>>>> 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 = fails >>>>>>> the following case: >>>>>>> >>>>>>> =A0 =A0 -P =A0 =A0Do not follow symbolic links in the file hierarch= y, instead >>>>>>> con- >>>>>>> =A0 =A0 =A0 =A0 =A0 sider the symbolic link itself in any compariso= ns. =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 spl= ice). >>>>>> ... >>>>>> I now see that the grammar error is from the original version of mtr= ee(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 traverse= s trees >>>>>> can work without a full complement of -[HLPR] or how any utility tha= t >>>>>> ... >>>>> >>>>> 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 = so >>>>> 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. >>> >>> s/withheld/held/ >>> >>> I guess the problem was the fact that I didn't use 8-space tabs for >>> first-level tabs? Hard tabs are fine, correct? >> >> =A0 =A0Ah, the braces for the single line conditional. Yes, I see what >> you mean now (fixed). >> =A0 =A0Also, I see what you mean about -P being broken; mtree(8) uses >> chmod instead of lchmod, chown instead of lchown, etc. This definitely >> needs fixing and I'll assign separate PRs for it. > > Sorry -- forgot the patch. A properly style(9)zed patch. Thanks, -Garrett --005045016ba0d819d70485fbe4b3 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_g8woe5t61 SW5kZXg6IHVzci5zYmluL210cmVlL2V4Y2x1ZGVzLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLnNiaW4v bXRyZWUvZXhjbHVkZXMuYwkocmV2aXNpb24gMjA3NzQwKQorKysgdXNyLnNiaW4vbXRyZWUvZXhj bHVkZXMuYwkod29ya2luZyBjb3B5KQpAQCAtMzAsOSArMzAsMTAgQEAKICNpbmNsdWRlIDxzeXMv Y2RlZnMuaD4KIF9fRkJTRElEKCIkRnJlZUJTRCQiKTsKIAorI2luY2x1ZGUgPHN5cy9xdWV1ZS5o PgorI2luY2x1ZGUgPHN5cy9zdGF0Lmg+CisjaW5jbHVkZSA8c3lzL3RpbWUuaD4JCS8qIFhYWCBm b3IgbXRyZWUuaCAqLwogI2luY2x1ZGUgPHN5cy90eXBlcy5oPgotI2luY2x1ZGUgPHN5cy90aW1l Lmg+CQkvKiBYWFggZm9yIG10cmVlLmggKi8KLSNpbmNsdWRlIDxzeXMvcXVldWUuaD4KIAogI2lu Y2x1ZGUgPGVyci5oPgogI2luY2x1ZGUgPGZubWF0Y2guaD4KQEAgLTYzLDEzICs2NCwyOSBAQAog dm9pZAogcmVhZF9leGNsdWRlc19maWxlKGNvbnN0IGNoYXIgKm5hbWUpCiB7CisJc3RydWN0IGV4 Y2x1ZGUgKmU7CisJc3RydWN0IHN0YXQgZXhjbHVkZV9zd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