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

Re: [PATCH di/fast-import-deltified-tree] Windows: define S_ISUID properly

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Sep 21, 2011, 07:38 UTC
Message-ID
<loom.20110921T092135-714@post.gmane.org>
In-Reply-To
<4E798538.7070106@viscovery.net>
Johannes Sixt <j.sixt <at> viscovery.net> writes:
Show 30 quoted lines
> 
> From: Johannes Sixt <j6t <at> kdbg.org>
> 
> 8fb3ad76 (fast-import: prevent producing bad delta) introduced the first
> use of S_ISUID. Since before this commit the value was irrelevant, we had
> only a dummy definition in mingw.h. But beginning with this commit the
> macro must expand to a reasonable value. Make it so.
> 
> We do not change S_ISGID from the value 0 because it is used in path.c
> (via FORCE_DIR_SET_GID) to set the mode on directories in a manner that
> is not supported on Windows, and 0 is the right value in this case.
> 
> Signed-off-by: Johannes Sixt <j6t <at> kdbg.org>
> ---
>  compat/mingw.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/compat/mingw.h b/compat/mingw.h
> index 547568b..e2c89d6 100644
> --- a/compat/mingw.h
> +++ b/compat/mingw.h
> @@ -22,7 +22,7 @@ typedef int socklen_t;
>  #define S_IWOTH 0
>  #define S_IXOTH 0
>  #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
> -#define S_ISUID 0
> +#define S_ISUID 04000
>  #define S_ISGID 0
>  #define S_ISVTX 0
> 

Ow, it's awkward that the issue was discussed in [1] but slipped and nobody noticed, especially me being a patch sender.

If we choose patch from [1] I'd also change a comment to smth like
/* 
 * We abuse the 04000 bit on directories to mean "do not delta".
 * It is a S_ISUID bit on setuid platforms and an unused bit on
 * non-setuid platforms supported in git. In either case git ignores
 * the bit, so it's safe to abuse it locally.
 */
[1] http://thread.gmane.org/gmane.comp.version-control.git/179223/focus=179762
Previous: Johannes SixtNext: Junio C Hamano
Message 2 of 6 in “Windows: define S_ISUID properly”
  1. Windows: define S_ISUID properlyJohannes Sixt, Sep 21, 2011
  2. Dmitry IvankovSep 21, 2011
  3. Junio C HamanoSep 21, 2011
  4. Junio C HamanoSep 21, 2011
  5. Dmitry IvankovSep 21, 2011
  6. Junio C HamanoSep 21, 2011

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.