Skip to content

Commit 0b20dd8

Browse files
jrngitster
authored andcommitted
Makefile: do not set setgid bit on directories on GNU/kFreeBSD
The g+s bit on directories to make group ownership inherited is a SysVism --- BSD and most of its descendants do not need it since they do the sane thing by default without g+s. In fact, on some filesystems (but not all --- tmpfs works this way but UFS does not), the kernel of FreeBSD does not even allow non-root users to set setgid bit on directories and produces errors when one tries: $ git init --shared dir fatal: Could not make /tmp/dir/.git/refs writable by group Since the setgid bit would only mean "do what you were going to do already", it's better to avoid setting it. Accordingly, ever since v1.5.5-rc0~59^2 (Do not use GUID on dir in git init --share=all on FreeBSD, 2008-03-05), git on true FreeBSD has done exactly that. Set DIR_HAS_BSD_GROUP_SEMANTICS in the makefile for GNU/kFreeBSD, too, so machines that use glibc with the kernel of FreeBSD get the same fix. This fixes t0001-init.sh and t1301-shared-repo.sh on GNU/kFreeBSD when running tests with --root pointing to a directory that uses tmpfs. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 703f05a commit 0b20dd8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ ifeq ($(uname_S),GNU/kFreeBSD)
820820
NO_STRLCPY = YesPlease
821821
NO_MKSTEMPS = YesPlease
822822
HAVE_PATHS_H = YesPlease
823+
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
823824
endif
824825
ifeq ($(uname_S),UnixWare)
825826
CC = cc

0 commit comments

Comments
 (0)