git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] t4129: don't fail if setgid is set in the test directory

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2021, 23:59 UTC
Message-ID
<xmqqlfd5obvx.fsf@gitster.c.googlers.com>
In-Reply-To
<b734425e3235651e738e6eac47eae0db7db92e7e.1609861567.git.matheus.bernardino@usp.br>
Matheus Tavares <matheus.bernardino@usp.br> writes:
Show 5 quoted lines
> +# 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.
Previous: Matheus TavaresNext: Matheus Tavares Bernardino
Message 6 of 7 in “t4129 failure when sticky bit set”
  1. Kevin DaudtDec 30, 2020
  2. t4129: don't fail if setgid is set in the parent directoryMatheus Tavares, Dec 30, 2020
  3. Kevin DaudtDec 30, 2020
  4. Junio C HamanoJan 4, 2021
  5. t4129: don't fail if setgid is set in the test directoryMatheus Tavares, Jan 5, 2021
  6. Junio C HamanoJan 6, 2021
  7. Matheus Tavares BernardinoJan 9, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.