From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2316E431E62 for ; Thu, 13 Jun 2013 13:19:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N+n5hNPBxFlC for ; Thu, 13 Jun 2013 13:19:42 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 94BC1431FC2 for ; Thu, 13 Jun 2013 13:19:42 -0700 (PDT) X-AuditID: 12074422-b7f746d000001b30-08-51ba295d08fc Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id CA.8D.06960.D592AB15; Thu, 13 Jun 2013 16:19:41 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r5DKJeSR014226; Thu, 13 Jun 2013 16:19:41 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r5DKJcxv029959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 13 Jun 2013 16:19:39 -0400 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1UnDzc-0008Jr-Ro; Thu, 13 Jun 2013 16:19:37 -0400 Date: Thu, 13 Jun 2013 16:19:35 -0400 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH 1/1] test/basic: replaced find -perm +111 with portable alternative Message-ID: <20130613201935.GI22196@mit.edu> References: <1370641049-17390-1-git-send-email-tomi.ollila@iki.fi> <20130610155940.GE22196@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCKsWRmVeSWpSXmKPExsUixG6nrhunuSvQ4KaKxfWbM5kt3qycx+rA 5HH460IWj2erbjEHMEVx2aSk5mSWpRbp2yVwZZz9/oGp4IVgxeQzvA2MTXxdjJwcEgImEjv3 PGaBsMUkLtxbz9bFyMUhJLCPUeL2gw2sEM5GRonnFz4yQjinmSQ6t75jh3CWMEr0333NDNLP IqAqsX/pUzCbTUBDYtv+5YwgtoiAisSDtvWsIDazgLTEt9/NTCC2sECkRMOEB2C7eQV0JFoW 3ITa3c0ocWH3O1aIhKDEyZlPWCCatSRu/HsJ1MwBNmj5Pw4Qk1PAQOLpXUmQClGgVVNObmOb wCg0C0nzLCTNsxCaFzAyr2KUTcmt0s1NzMwpTk3WLU5OzMtLLdI11cvNLNFLTSndxAgOahel HYw/DyodYhTgYFTi4U24sDNQiDWxrLgy9xCjJAeTkihvusquQCG+pPyUyozE4oz4otKc1OJD jBIczEoivOF/gcp5UxIrq1KL8mFS0hwsSuK8YreAUgLpiSWp2ampBalFMFkZDg4lCd4CDaCh gkWp6akVaZk5JQhpJg5OkOE8QMNngtTwFhck5hZnpkPkTzEac0w+u+U9I8fN91vfMwqx5OXn pUqJ8zaClAqAlGaU5sFNgyWmV4ziQM8J884CqeIBJjW4ea+AVjEBrSrK2A6yqiQRISXVwDiJ 622RO9fCHfXdNy4c5nzl17HZepPK0gDFBVnrHQr5yh862Uz7+Emlk/WmJuv+6CU+J1q2BZyQ W5TRsk7KZ6+I/N09MTe1fhR+vv/41kndvqLmhTN7haaqJrpOO7rAi+ePm+zvrpiSnjfMSv+f K6bmNb8LTTjCIWWw8r/kBb+qKMlIw74uYSWW4oxEQy3mouJEAP5cjyAnAwAA Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jun 2013 20:19:50 -0000 Quoth Tomi Ollila on Jun 13 at 10:47 pm: > On Mon, Jun 10 2013, Austin Clements wrote: > > > LGTM. Though, I wonder, why not *just* -perm -100? That isn't quite > > a correct test of whether the user can execute it: e.g., if the file > > is owned by some other user and a group the current user isn't in, > > then -perm -1 is the correct test, though unless the file has some > > unusual permissions, -perm -100 is likely to pass anyway. But the > > test you have (and the test that was there before) isn't quite correct > > either: if the file is owned by the current user and has some crazy > > permission like 0611, the user won't be able to execute it, even > > though someone else could. > > While giving considerable amount of thought for such an insignificant > issue I came to realize this: > > The purpose of the '-perm ...' part in that expression is not to check > whether the file is executable by the user but just to reduce the set > of files the whole expression returns without need to "blacklist" more > files that are already blacklisted with '! -name ...' subexpressions > ("Makefile", ".gitignore" and so on). > > With +111, /ppp and their portable alternative > ( -perm -100 -or -perm -10 -or -perm 1 ) the implicit reduction this > part does is smaller than with -100. > > The returned list is then compared with ${TESTS} and if there is no > exact match then this particular test fails. > > Whatever this test result is, the execution of any file in ${TESTS} > will fail with "permission denied" if it is not executable by > the user running the tests. > > I think that as we're doing this "shortcut" instead of full file > blacklisting, this should reduce the output less rather than > more and therefore use the version provided in this patch > instead of changing +111 to -100. > > (In the future I'd like to see that we had some convention to name > the test scripts and either do comparison to that list or that > convention also dictates order and this test could be removed. There > are a few alternatives that we could think of...). Okay. (I completely agree that the right solution here is switching to a naming convention and eliminating the hand-made list of tests.)