summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce2cf27)
raw | patch | inline | side by side (parent: ce2cf27)
author | Alex Riesen <raa.lkml@gmail.com> | |
Tue, 4 Mar 2008 23:15:39 +0000 (00:15 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Mar 2008 20:22:26 +0000 (12:22 -0800) |
It does not allow changing the bit to a non-root user.
This fixes t1301-shared-repo.sh on the platform.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This fixes t1301-shared-repo.sh on the platform.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | patch | blob | history | |
git-compat-util.h | patch | blob | history | |
path.c | patch | blob | history |
diff --git a/Makefile b/Makefile
index ca5aad963ca7b5565338f49ce1705c451216c8be..6e857e62c3d02fa2bfef7b9224e24d5b6a279c9c 100644 (file)
--- a/Makefile
+++ b/Makefile
NO_MEMMEM = YesPlease
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
+ DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
EXTLIBS += -lpthread
LIB_OBJS += thread-utils.o
endif
+ifdef DIR_HAS_BSD_GROUP_SEMANTICS
+ COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
+endif
ifeq ($(TCLTK_PATH),)
NO_TCLTK=NoThanks
diff --git a/git-compat-util.h b/git-compat-util.h
index 2a40703c851d7011723588dd7643dc034db49c31..591244351ec4e410ea3b7f891d0de2f33a5aff7a 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#define qsort git_qsort
#endif
+#ifndef DIR_HAS_BSD_GROUP_SEMANTICS
+# define FORCE_DIR_SET_GID S_ISGID
+#else
+# define FORCE_DIR_SET_GID 0
+#endif
+
#endif
index af2716199b92e920df9fe2021035d319e8cafbc6..f4ed979997b6a968ba1987a199beae39035d5da2 100644 (file)
--- a/path.c
+++ b/path.c
? (S_IXGRP|S_IXOTH)
: 0));
if (S_ISDIR(mode))
- mode |= S_ISGID;
+ mode |= FORCE_DIR_SET_GID;
if ((mode & st.st_mode) != mode && chmod(path, mode) < 0)
return -2;
return 0;