unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/1] test/basic: replaced find -perm +111 with portable alternative
Date: Mon, 10 Jun 2013 11:59:40 -0400	[thread overview]
Message-ID: <20130610155940.GE22196@mit.edu> (raw)
In-Reply-To: <1370641049-17390-1-git-send-email-tomi.ollila@iki.fi>

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			\

  reply	other threads:[~2013-06-10 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 21:37 [PATCH 1/1] test/basic: replaced find -perm +111 with portable alternative Tomi Ollila
2013-06-10 15:59 ` Austin Clements [this message]
2013-06-13 19:47   ` Tomi Ollila
2013-06-13 20:19     ` Austin Clements
2013-06-25  6:07 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130610155940.GE22196@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).