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

Re: [PATCH] Do not use GUID on dir in git init --shared=all on FreeBSD 4.11p2

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2008, 20:44 UTC
Message-ID
<7vr6eq43te.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080304202047.GC3295@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
> It does not allow changing the bit to a non-root user.
> This fixes t1301-shared-repo.sh on the platform.
 ...
Show 12 quoted lines
> diff --git a/path.c b/path.c
> index af27161..6f09ba2 100644
> --- a/path.c
> +++ b/path.c
> @@ -282,8 +282,10 @@ int adjust_shared_perm(const char *path)
>  			 : (shared_repository == PERM_EVERYBODY
>  			    ? (S_IXGRP|S_IXOTH)
>  			    : 0));
> +#if !defined(__FreeBSD__) || (__FreeBSD__ > 4)
>  	if (S_ISDIR(mode))
>  		mode |= S_ISGID;
> +#endif
As usual, please do something like
(1) In git-compat-util.h
    #ifndef MKDIR_HAS_BSD_GROUP_SEMANTICS
    #define FORCE_BSD_GROUP_SEMANTICS S_ISGID
    #else
    #define FORCE_BSD_GROUP_SEMANTICS 0
    #endif
(2) In Makefile (and configure.in perhaps)
    ifeq ($(uname_S),FreeBSD)
    	MKDIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
    endif
    ...
    ifdef MKDIR_HAS_BSD_GROUP_SEMANTICS
        COMPAT_CFLAGS += -DMKDIR_HAS_BSD_GROUP_SEMANTICS
    endif
(3) In the above codepath:
	if (S_ISDIR(mode))
        	mode |= FORCE_BSD_GROUP_SEMANTICS;
or something.  Avoid #if directly based on platform names in *.c files.
Previous: Alex RiesenNext: Alex Riesen
Message 6 of 10 in “Fix git init --shared=all on FreeBSD 4.11”
  1. Fix git init --shared=all on FreeBSD 4.11Alex Riesen, Mar 3, 2008
  2. Junio C HamanoMar 4, 2008
  3. Alex RiesenMar 4, 2008
  4. Junio C HamanoMar 4, 2008
  5. Do not use GUID on dir in git init --shared=all on FreeBSD 4.11p2Alex Riesen, Mar 4, 2008
  6. Junio C HamanoMar 4, 2008
  7. Alex RiesenMar 4, 2008
  8. Do not use GUID on dir in git init --shared=all on FreeBSDAlex Riesen, Mar 4, 2008
  9. Johannes SchindelinMar 4, 2008
  10. Alex RiesenMar 4, 2008

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.