From a4f7f3cfda978ac1ee3991f918d7f7c7e526afac Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 11 Jun 2013 11:59:40 +2000 Subject: [PATCH] Re: [PATCH 1/1] test/basic: replaced find -perm +111 with portable alternative --- 31/8b183c83544a5935426c449a75ece0702b354b | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 31/8b183c83544a5935426c449a75ece0702b354b diff --git a/31/8b183c83544a5935426c449a75ece0702b354b b/31/8b183c83544a5935426c449a75ece0702b354b new file mode 100644 index 000000000..1a7d780e7 --- /dev/null +++ b/31/8b183c83544a5935426c449a75ece0702b354b @@ -0,0 +1,111 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 163F9431FB6 + for ; Mon, 10 Jun 2013 08:59:56 -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 o8sPFYXvIx4Y for ; + Mon, 10 Jun 2013 08:59:48 -0700 (PDT) +Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu + [18.9.25.15]) + by olra.theworths.org (Postfix) with ESMTP id 98522431FAE + for ; Mon, 10 Jun 2013 08:59:48 -0700 (PDT) +X-AuditID: 1209190f-b7f836d000000ca7-c3-51b5f7f43ffd +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP + id 54.DD.03239.4F7F5B15; Mon, 10 Jun 2013 11:59:48 -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 r5AFxjQm003124; + Mon, 10 Jun 2013 11:59:46 -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 r5AFxgQm008970 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Mon, 10 Jun 2013 11:59:44 -0400 +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1Um4VR-0001qf-IQ; Mon, 10 Jun 2013 11:59:41 -0400 +Date: Mon, 10 Jun 2013 11:59:40 -0400 +From: Austin Clements +To: Tomi Ollila +Subject: Re: [PATCH 1/1] test/basic: replaced find -perm +111 with portable + alternative +Message-ID: <20130610155940.GE22196@mit.edu> +References: <1370641049-17390-1-git-send-email-tomi.ollila@iki.fi> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1370641049-17390-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IRYrdT1/3yfWugQecqXovrN2cyW7xZOY/V + gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4MrYeWo9c8FrnoqfU+YxNzD2cXUxcnJICJhI + HPrTwQZhi0lcuLcezBYS2Mcocb4xuouRC8jeyChx+8pWVgjnNJPE5jldUM4SRon5Hx8wg7Sw + CKhKbPp+HcxmE9CQ2LZ/OSOILSKgIvGgbT0riM0sIC3x7XczE4gtLBAp0TDhAQuIzSugI/Hu + 0ylmiNVOEp+uNbNDxAUlTs58wgLRqyVx499LoF4OsDnL/3GAhDkFnCWOfX4NdrUo0KopJ7ex + TWAUmoWkexaS7lkI3QsYmVcxyqbkVunmJmbmFKcm6xYnJ+blpRbpmujlZpbopaaUbmIEhTWn + JP8Oxm8HlQ4xCnAwKvHwdvzYEijEmlhWXJl7iFGSg0lJlHfOy62BQnxJ+SmVGYnFGfFFpTmp + xYcYJTiYlUR4k98A5XhTEiurUovyYVLSHCxK4rxXU276CwmkJ5akZqemFqQWwWRlODiUJHh9 + gfErJFiUmp5akZaZU4KQZuLgBBnOAzScE6SGt7ggMbc4Mx0if4pRUUqc1xokIQCSyCjNg+uF + pZ1XjOJArwjzSoFU8QBTFlz3K6DBTECDp6hvARlckoiQkmpgVFe7ViAnMvdIapBMU7+tcaOB + f6uZ4AJxVf3gJ9NkTPIrnltdCHc67qPT7yykalt/curzg0IX1waLy2zwreeTudm5/ftq1d0m + 7CanHoSeNlOcFV7vx/J3b0Rl47sgmxDztf6sGbO+hy5lC+bZ/vMEQ8Rm6b7vVrvb57QGvtX/ + WSjqKOyZJKTEUpyRaKjFXFScCAAd8EuCFgMAAA== +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: Mon, 10 Jun 2013 15:59:56 -0000 + +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. + +It's too bad "-executable" is a GNU extension. + +Quoth Tomi Ollila on Jun 08 at 12:37 am: +> The find option syntax `-perm +111` is deprecated gnu find feature. +> The replacement `( -perm -100 -o -perm -10 -o -perm 1 )` should also +> work outside of the GNU domain. +> --- +> test/basic | 3 ++- +> 1 file changed, 2 insertions(+), 1 deletion(-) +> +> diff --git a/test/basic b/test/basic +> index 1b2a7d2..64eb7d7 100755 +> --- a/test/basic +> +++ b/test/basic +> @@ -53,7 +53,8 @@ test_expect_code 2 'failure to clean up causes the test to fail' ' +> test_begin_subtest 'Ensure that all available tests will be run by notmuch-test' +> eval $(sed -n -e '/^TESTS="$/,/^"$/p' $TEST_DIRECTORY/notmuch-test) +> tests_in_suite=$(for i in $TESTS; do echo $i; done | sort) +> -available=$(find "$TEST_DIRECTORY" -maxdepth 1 -type f -perm +111 \ +> +available=$(find "$TEST_DIRECTORY" -maxdepth 1 -type f \ +> + '(' -perm -100 -o -perm -10 -o -perm -1 ')' \ +> ! -name aggregate-results.sh \ +> ! -name arg-test \ +> ! -name hex-xcode \ -- 2.26.2