public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Matheus Tavares <matheus.bernardino@usp•br>
Cc: me@ikke•info, git@vger•kernel.org
Subject: Re: [PATCH v2] t4129: don't fail if setgid is set in the test directory
Date: Wed, 06 Jan 2021 15:59:14 -0800	[thread overview]
Message-ID: <xmqqlfd5obvx.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <b734425e3235651e738e6eac47eae0db7db92e7e.1609861567.git.matheus.bernardino@usp.br> (Matheus Tavares's message of "Tue, 5 Jan 2021 12:47:39 -0300")

Matheus Tavares <matheus.bernardino@usp•br> writes:

> +# Get the modebits from a file or directory, ignoring the setgid bit (g+s).
> +# This bit is inherited by subdirectories at their creation. So we remove it
> +# from the returning string to prevent callers from having to worry about the
> +# state of the bit in the test directory.
> +#

We probably do not use "chmod g+s" manually on regular files, so I
may be being overly "correct", but shouldn't these be done only for
directories?

>  test_modebits () {
> -	ls -ld "$1" | sed -e 's|^\(..........\).*|\1|'
> +	ls -ld "$1" | sed -e 's|^\(..........\).*|\1|' \
> +			  -e 's|^\(......\)S|\1-|' -e 's|^\(......\)s|\1x|'

That is, 

			  -e 's|^\(d.....\)S|\1-|' -e 's|^\(d.....\)s|\1x|'

instead of applying the rule to any filetype.

Will queue as-is, as the distinction probably would not matter in
practice.

Thanks.

  reply	other threads:[~2021-01-07  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 12:05 t4129 failure when sticky bit set Kevin Daudt
2020-12-30 14:52 ` [PATCH] t4129: don't fail if setgid is set in the parent directory Matheus Tavares
2020-12-30 21:05   ` Kevin Daudt
2021-01-04 23:57   ` Junio C Hamano
2021-01-05 15:47   ` [PATCH v2] t4129: don't fail if setgid is set in the test directory Matheus Tavares
2021-01-06 23:59     ` Junio C Hamano [this message]
2021-01-09 14:19       ` Matheus Tavares Bernardino

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

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

  git send-email \
    --in-reply-to=xmqqlfd5obvx.fsf@gitster.c.googlers.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=matheus.bernardino@usp$(echo .)br \
    --cc=me@ikke$(echo .)info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox